From 1b84acb7917d9f88af5e664bc50c50d542429245 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 8 May 2008 16:42:09 -0700 Subject: [PATCH] Imported Upstream version 2.0 --- Makefile.am | 58 + Makefile.in | 858 + Shibboleth.sln | 238 + acinclude.m4 | 90 + aclocal.m4 | 864 + acx_pthread.m4 | 287 + adfs/Makefile.am | 25 + adfs/Makefile.in | 581 + adfs/adfs-lite.vcproj | 198 + adfs/adfs.cpp | 899 + adfs/adfs.rc | 117 + adfs/adfs.vcproj | 197 + adfs/resource.h | 15 + apache/Makefile.am | 47 + apache/Makefile.in | 698 + apache/mod_apache.cpp | 1555 ++ apache/mod_shib13.vcproj | 239 + apache/mod_shib20.vcproj | 241 + apache/mod_shib22.vcproj | 245 + apache/mod_shib_13.cpp | 39 + apache/mod_shib_13.rc | 109 + apache/mod_shib_20.cpp | 62 + apache/mod_shib_20.rc | 109 + apache/mod_shib_22.cpp | 64 + apache/mod_shib_22.rc | 109 + apache/resource.h | 15 + config.guess | 1411 + config.h.in | 126 + config.sub | 1500 + config_win32.h | 138 + configs/Makefile.am | 140 + configs/Makefile.in | 580 + configs/accessError.html | 27 + configs/apache.config.in | 52 + configs/apache2.config.in | 39 + configs/apache22.config.in | 39 + configs/attribute-map.xml | 122 + configs/attribute-policy.xml | 62 + configs/bindingTemplate.html | 58 + configs/console.logger | 31 + configs/discoveryTemplate.html | 44 + configs/example-metadata.xml | 195 + configs/globalLogout.html | 40 + configs/keygen.bat | 98 + configs/keygen.sh | 69 + configs/localLogout.html | 24 + configs/metadataError.html | 33 + configs/native.logger.in | 35 + configs/sessionError.html | 43 + configs/shibboleth2.xml | 258 + configs/shibd-debian.in | 84 + configs/shibd-osx.plist.in | 20 + configs/shibd-redhat.in | 84 + configs/shibd.logger.in | 47 + configs/sslError.html | 28 + configs/syslog.logger | 33 + configs/upgrade.xsl | 482 + configs/xsltproc.js | 45 + configure | 27735 +++++++++++++++++++ configure.ac | 888 + depcomp | 479 + depend | 12 + doc/CREDITS.txt | 89 + doc/FASTCGI.LICENSE | 28 + doc/LICENSE.txt | 201 + doc/LOG4CPP.LICENSE | 504 + doc/Makefile.am | 19 + doc/Makefile.in | 452 + doc/NOTICE.txt | 14 + doc/OPENSSL.LICENSE | 127 + doc/README.txt | 28 + doc/RELEASE.txt | 114 + doc/logo.jpg | Bin 0 -> 13660 bytes doc/main.css | 39 + doxygen.am | 186 + doxygen.cfg | 255 + doxygen.m4 | 312 + fastcgi/Makefile.am | 30 + fastcgi/Makefile.in | 607 + fastcgi/resource.h | 15 + fastcgi/shibauthorizer.cpp | 407 + fastcgi/shibauthorizer.rc | 109 + fastcgi/shibauthorizer.vcproj | 225 + fastcgi/shibresponder.cpp | 408 + fastcgi/shibresponder.rc | 109 + fastcgi/shibresponder.vcproj | 225 + install-sh | 294 + isapi_shib/directive_class.h | 233 + isapi_shib/directives.h | 45 + isapi_shib/isapi_shib.cpp | 949 + isapi_shib/isapi_shib.rc | 109 + isapi_shib/isapi_shib.vcproj | 220 + isapi_shib/resource.h | 15 + libtool.m4 | 5960 ++++ ltmain.sh | 6425 +++++ missing | 336 + mkinstalldirs | 111 + nsapi_shib/Makefile.am | 17 + nsapi_shib/Makefile.in | 571 + nsapi_shib/nsapi_shib.cpp | 600 + nsapi_shib/nsapi_shib.rc | 109 + nsapi_shib/nsapi_shib.vcproj | 217 + nsapi_shib/resource.h | 15 + odbc-store/Makefile.am | 20 + odbc-store/Makefile.in | 563 + odbc-store/odbc-store.cpp | 866 + odbc-store/odbc-store.rc | 101 + odbc-store/odbc-store.vcproj | 195 + odbc-store/resource.h | 14 + pkginfo | 11 + pkginfo.in | 11 + postinstall | 34 + schemas/Makefile.am | 38 + schemas/Makefile.in | 471 + schemas/WS-Trust.xsd | 113 + schemas/catalog.xml.in | 12 + schemas/shibboleth-2.0-afp-mf-basic.xsd | 371 + schemas/shibboleth-2.0-afp-mf-saml.xsd | 60 + schemas/shibboleth-2.0-afp.xsd | 187 + schemas/shibboleth-2.0-attribute-map.xsd | 127 + schemas/shibboleth-2.0-native-sp-config.xsd | 706 + schemas/shibboleth-2.0-sp-notify.xsd | 64 + schemas/shibboleth-metadata-1.0.xsd | 42 + schemas/shibboleth.xsd | 300 + selinux/Makefile.am | 25 + selinux/Makefile.in | 476 + selinux/shibshar.fc.in | 4 + selinux/shibshar.te | 33 + shibboleth.spec | 258 + shibboleth.spec.in | 258 + shibd/Makefile.am | 14 + shibd/Makefile.in | 548 + shibd/resource.h | 15 + shibd/shibd.cpp | 344 + shibd/shibd.rc | 109 + shibd/shibd.vcproj | 211 + shibd/shibd_win32.cpp | 529 + shibsp/AbstractSPRequest.cpp | 301 + shibsp/AbstractSPRequest.h | 107 + shibsp/AccessControl.h | 80 + shibsp/Application.cpp | 101 + shibsp/Application.h | 270 + shibsp/Makefile.am | 212 + shibsp/Makefile.in | 2031 ++ shibsp/RequestMapper.h | 73 + shibsp/SPConfig.cpp | 253 + shibsp/SPConfig.h | 292 + shibsp/SPRequest.h | 169 + shibsp/ServiceProvider.cpp | 533 + shibsp/ServiceProvider.h | 201 + shibsp/SessionCache.h | 315 + shibsp/SessionCacheEx.h | 92 + shibsp/TransactionLog.h | 67 + shibsp/attribute/Attribute.cpp | 105 + shibsp/attribute/Attribute.h | 275 + shibsp/attribute/AttributeDecoder.h | 82 + shibsp/attribute/NameIDAttribute.h | 187 + shibsp/attribute/NameIDAttributeDecoder.cpp | 228 + shibsp/attribute/ScopedAttribute.h | 141 + shibsp/attribute/ScopedAttributeDecoder.cpp | 198 + shibsp/attribute/SimpleAttribute.h | 85 + shibsp/attribute/StringAttributeDecoder.cpp | 149 + shibsp/attribute/filtering/AttributeFilter.h | 66 + shibsp/attribute/filtering/BasicFilteringContext.h | 92 + shibsp/attribute/filtering/FilterPolicyContext.h | 67 + shibsp/attribute/filtering/FilteringContext.h | 110 + shibsp/attribute/filtering/MatchFunctor.h | 127 + .../attribute/filtering/impl/AndMatchFunctor.cpp | 119 + .../attribute/filtering/impl/AnyMatchFunctor.cpp | 50 + .../attribute/filtering/impl/AttributeFilter.cpp | 40 + .../impl/AttributeIssuerInEntityGroupFunctor.cpp | 72 + .../filtering/impl/AttributeIssuerRegexFunctor.cpp | 75 + .../impl/AttributeIssuerStringFunctor.cpp | 59 + .../AttributeRequesterInEntityGroupFunctor.cpp | 72 + .../impl/AttributeRequesterRegexFunctor.cpp | 75 + .../impl/AttributeRequesterStringFunctor.cpp | 59 + .../AttributeScopeMatchesShibMDScopeFunctor.cpp | 118 + .../filtering/impl/AttributeScopeRegexFunctor.cpp | 110 + .../filtering/impl/AttributeScopeStringFunctor.cpp | 87 + .../filtering/impl/AttributeValueRegexFunctor.cpp | 110 + .../filtering/impl/AttributeValueStringFunctor.cpp | 103 + .../impl/AuthenticationMethodRegexFunctor.cpp | 75 + .../impl/AuthenticationMethodStringFunctor.cpp | 60 + .../filtering/impl/ChainingAttributeFilter.cpp | 90 + shibsp/attribute/filtering/impl/MatchFunctor.cpp | 127 + .../attribute/filtering/impl/NotMatchFunctor.cpp | 109 + .../impl/NumberOfAttributeValuesFunctor.cpp | 89 + shibsp/attribute/filtering/impl/OrMatchFunctor.cpp | 115 + .../filtering/impl/XMLAttributeFilter.cpp | 397 + shibsp/attribute/resolver/AttributeExtractor.h | 83 + shibsp/attribute/resolver/AttributeResolver.h | 125 + shibsp/attribute/resolver/ResolutionContext.h | 69 + .../resolver/impl/ChainingAttributeExtractor.cpp | 117 + .../resolver/impl/ChainingAttributeResolver.cpp | 194 + .../resolver/impl/QueryAttributeResolver.cpp | 562 + .../resolver/impl/XMLAttributeExtractor.cpp | 544 + shibsp/base.h | 106 + shibsp/binding/ArtifactResolver.h | 53 + shibsp/binding/SOAPClient.h | 87 + shibsp/binding/impl/ArtifactResolver.cpp | 158 + shibsp/binding/impl/SOAPClient.cpp | 195 + shibsp/exceptions.h | 58 + shibsp/handler/AbstractHandler.h | 174 + shibsp/handler/AssertionConsumerService.h | 174 + shibsp/handler/Handler.h | 94 + shibsp/handler/LogoutHandler.h | 142 + shibsp/handler/RemotedHandler.h | 92 + shibsp/handler/SessionInitiator.h | 94 + shibsp/handler/impl/AbstractHandler.cpp | 389 + shibsp/handler/impl/AssertionConsumerService.cpp | 467 + shibsp/handler/impl/AssertionLookup.cpp | 207 + shibsp/handler/impl/ChainingLogoutInitiator.cpp | 128 + shibsp/handler/impl/ChainingSessionInitiator.cpp | 120 + shibsp/handler/impl/CookieSessionInitiator.cpp | 90 + shibsp/handler/impl/FormSessionInitiator.cpp | 123 + shibsp/handler/impl/LocalLogoutInitiator.cpp | 117 + shibsp/handler/impl/LogoutHandler.cpp | 255 + shibsp/handler/impl/MetadataGenerator.cpp | 385 + shibsp/handler/impl/RemotedHandler.cpp | 332 + shibsp/handler/impl/SAML1Consumer.cpp | 290 + shibsp/handler/impl/SAML2ArtifactResolution.cpp | 345 + shibsp/handler/impl/SAML2Consumer.cpp | 406 + shibsp/handler/impl/SAML2Logout.cpp | 602 + shibsp/handler/impl/SAML2LogoutInitiator.cpp | 482 + shibsp/handler/impl/SAML2NameIDMgmt.cpp | 589 + shibsp/handler/impl/SAML2SessionInitiator.cpp | 650 + shibsp/handler/impl/SAMLDSSessionInitiator.cpp | 221 + shibsp/handler/impl/SessionHandler.cpp | 195 + shibsp/handler/impl/SessionInitiator.cpp | 76 + shibsp/handler/impl/Shib1SessionInitiator.cpp | 267 + shibsp/handler/impl/StatusHandler.cpp | 491 + shibsp/handler/impl/TransformSessionInitiator.cpp | 282 + shibsp/handler/impl/WAYFSessionInitiator.cpp | 146 + shibsp/impl/StorageServiceSessionCache.cpp | 1668 ++ shibsp/impl/XMLAccessControl.cpp | 450 + shibsp/impl/XMLRequestMapper.cpp | 654 + shibsp/impl/XMLServiceProvider.cpp | 1504 + shibsp/internal.h | 51 + shibsp/lite/CommonDomainCookie.cpp | 100 + shibsp/lite/CommonDomainCookie.h | 82 + shibsp/lite/SAMLConstants.cpp | 207 + shibsp/lite/SAMLConstants.h | 160 + shibsp/metadata/MetadataExt.h | 55 + shibsp/metadata/MetadataExtImpl.cpp | 162 + shibsp/metadata/MetadataExtSchemaValidators.cpp | 52 + shibsp/paths.h | 46 + shibsp/paths.h.in | 46 + shibsp/remoting/ListenerService.h | 147 + shibsp/remoting/ddf.h | 161 + shibsp/remoting/impl/ListenerService.cpp | 98 + shibsp/remoting/impl/SocketListener.cpp | 555 + shibsp/remoting/impl/SocketListener.h | 93 + shibsp/remoting/impl/TCPListener.cpp | 215 + shibsp/remoting/impl/UnixListener.cpp | 159 + shibsp/remoting/impl/ddf.cpp | 1011 + shibsp/resource.h | 15 + shibsp/security/PKIXTrustEngine.cpp | 287 + shibsp/security/PKIXTrustEngine.h | 38 + shibsp/security/SecurityPolicy.cpp | 36 + shibsp/security/SecurityPolicy.h | 65 + shibsp/shibsp-lite.vcproj | 572 + shibsp/shibsp.rc | 137 + shibsp/shibsp.vcproj | 799 + shibsp/util/CGIParser.cpp | 124 + shibsp/util/CGIParser.h | 77 + shibsp/util/DOMPropertySet.cpp | 230 + shibsp/util/DOMPropertySet.h | 85 + shibsp/util/PropertySet.h | 127 + shibsp/util/SPConstants.cpp | 116 + shibsp/util/SPConstants.h | 84 + shibsp/util/TemplateParameters.cpp | 85 + shibsp/util/TemplateParameters.h | 84 + shibsp/version.h | 74 + util/Makefile.am | 19 + util/Makefile.in | 558 + util/mdquery.cpp | 182 + util/mdquery.vcproj | 199 + util/resolvertest.cpp | 329 + util/resolvertest.vcproj | 200 + 279 files changed, 103113 insertions(+) create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 Shibboleth.sln create mode 100644 acinclude.m4 create mode 100644 aclocal.m4 create mode 100644 acx_pthread.m4 create mode 100644 adfs/Makefile.am create mode 100644 adfs/Makefile.in create mode 100644 adfs/adfs-lite.vcproj create mode 100644 adfs/adfs.cpp create mode 100644 adfs/adfs.rc create mode 100644 adfs/adfs.vcproj create mode 100644 adfs/resource.h create mode 100644 apache/Makefile.am create mode 100644 apache/Makefile.in create mode 100644 apache/mod_apache.cpp create mode 100644 apache/mod_shib13.vcproj create mode 100644 apache/mod_shib20.vcproj create mode 100644 apache/mod_shib22.vcproj create mode 100644 apache/mod_shib_13.cpp create mode 100644 apache/mod_shib_13.rc create mode 100644 apache/mod_shib_20.cpp create mode 100644 apache/mod_shib_20.rc create mode 100644 apache/mod_shib_22.cpp create mode 100644 apache/mod_shib_22.rc create mode 100644 apache/resource.h create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.sub create mode 100644 config_win32.h create mode 100644 configs/Makefile.am create mode 100644 configs/Makefile.in create mode 100644 configs/accessError.html create mode 100644 configs/apache.config.in create mode 100644 configs/apache2.config.in create mode 100644 configs/apache22.config.in create mode 100644 configs/attribute-map.xml create mode 100644 configs/attribute-policy.xml create mode 100644 configs/bindingTemplate.html create mode 100644 configs/console.logger create mode 100644 configs/discoveryTemplate.html create mode 100644 configs/example-metadata.xml create mode 100644 configs/globalLogout.html create mode 100644 configs/keygen.bat create mode 100755 configs/keygen.sh create mode 100644 configs/localLogout.html create mode 100644 configs/metadataError.html create mode 100644 configs/native.logger.in create mode 100644 configs/sessionError.html create mode 100644 configs/shibboleth2.xml create mode 100644 configs/shibd-debian.in create mode 100644 configs/shibd-osx.plist.in create mode 100644 configs/shibd-redhat.in create mode 100644 configs/shibd.logger.in create mode 100644 configs/sslError.html create mode 100644 configs/syslog.logger create mode 100644 configs/upgrade.xsl create mode 100644 configs/xsltproc.js create mode 100755 configure create mode 100644 configure.ac create mode 100755 depcomp create mode 100644 depend create mode 100755 doc/CREDITS.txt create mode 100644 doc/FASTCGI.LICENSE create mode 100644 doc/LICENSE.txt create mode 100644 doc/LOG4CPP.LICENSE create mode 100644 doc/Makefile.am create mode 100644 doc/Makefile.in create mode 100644 doc/NOTICE.txt create mode 100644 doc/OPENSSL.LICENSE create mode 100644 doc/README.txt create mode 100644 doc/RELEASE.txt create mode 100644 doc/logo.jpg create mode 100644 doc/main.css create mode 100644 doxygen.am create mode 100644 doxygen.cfg create mode 100644 doxygen.m4 create mode 100644 fastcgi/Makefile.am create mode 100644 fastcgi/Makefile.in create mode 100644 fastcgi/resource.h create mode 100644 fastcgi/shibauthorizer.cpp create mode 100644 fastcgi/shibauthorizer.rc create mode 100644 fastcgi/shibauthorizer.vcproj create mode 100644 fastcgi/shibresponder.cpp create mode 100644 fastcgi/shibresponder.rc create mode 100644 fastcgi/shibresponder.vcproj create mode 100755 install-sh create mode 100644 isapi_shib/directive_class.h create mode 100644 isapi_shib/directives.h create mode 100644 isapi_shib/isapi_shib.cpp create mode 100644 isapi_shib/isapi_shib.rc create mode 100644 isapi_shib/isapi_shib.vcproj create mode 100644 isapi_shib/resource.h create mode 100644 libtool.m4 create mode 100644 ltmain.sh create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 nsapi_shib/Makefile.am create mode 100644 nsapi_shib/Makefile.in create mode 100644 nsapi_shib/nsapi_shib.cpp create mode 100644 nsapi_shib/nsapi_shib.rc create mode 100644 nsapi_shib/nsapi_shib.vcproj create mode 100644 nsapi_shib/resource.h create mode 100644 odbc-store/Makefile.am create mode 100644 odbc-store/Makefile.in create mode 100644 odbc-store/odbc-store.cpp create mode 100644 odbc-store/odbc-store.rc create mode 100644 odbc-store/odbc-store.vcproj create mode 100644 odbc-store/resource.h create mode 100644 pkginfo create mode 100644 pkginfo.in create mode 100644 postinstall create mode 100644 schemas/Makefile.am create mode 100644 schemas/Makefile.in create mode 100644 schemas/WS-Trust.xsd create mode 100644 schemas/catalog.xml.in create mode 100644 schemas/shibboleth-2.0-afp-mf-basic.xsd create mode 100644 schemas/shibboleth-2.0-afp-mf-saml.xsd create mode 100644 schemas/shibboleth-2.0-afp.xsd create mode 100644 schemas/shibboleth-2.0-attribute-map.xsd create mode 100644 schemas/shibboleth-2.0-native-sp-config.xsd create mode 100644 schemas/shibboleth-2.0-sp-notify.xsd create mode 100644 schemas/shibboleth-metadata-1.0.xsd create mode 100644 schemas/shibboleth.xsd create mode 100644 selinux/Makefile.am create mode 100644 selinux/Makefile.in create mode 100644 selinux/shibshar.fc.in create mode 100644 selinux/shibshar.te create mode 100644 shibboleth.spec create mode 100644 shibboleth.spec.in create mode 100644 shibd/Makefile.am create mode 100644 shibd/Makefile.in create mode 100644 shibd/resource.h create mode 100644 shibd/shibd.cpp create mode 100644 shibd/shibd.rc create mode 100644 shibd/shibd.vcproj create mode 100644 shibd/shibd_win32.cpp create mode 100644 shibsp/AbstractSPRequest.cpp create mode 100644 shibsp/AbstractSPRequest.h create mode 100644 shibsp/AccessControl.h create mode 100644 shibsp/Application.cpp create mode 100644 shibsp/Application.h create mode 100644 shibsp/Makefile.am create mode 100644 shibsp/Makefile.in create mode 100644 shibsp/RequestMapper.h create mode 100644 shibsp/SPConfig.cpp create mode 100644 shibsp/SPConfig.h create mode 100644 shibsp/SPRequest.h create mode 100644 shibsp/ServiceProvider.cpp create mode 100644 shibsp/ServiceProvider.h create mode 100644 shibsp/SessionCache.h create mode 100644 shibsp/SessionCacheEx.h create mode 100644 shibsp/TransactionLog.h create mode 100644 shibsp/attribute/Attribute.cpp create mode 100644 shibsp/attribute/Attribute.h create mode 100644 shibsp/attribute/AttributeDecoder.h create mode 100644 shibsp/attribute/NameIDAttribute.h create mode 100644 shibsp/attribute/NameIDAttributeDecoder.cpp create mode 100644 shibsp/attribute/ScopedAttribute.h create mode 100644 shibsp/attribute/ScopedAttributeDecoder.cpp create mode 100644 shibsp/attribute/SimpleAttribute.h create mode 100644 shibsp/attribute/StringAttributeDecoder.cpp create mode 100644 shibsp/attribute/filtering/AttributeFilter.h create mode 100644 shibsp/attribute/filtering/BasicFilteringContext.h create mode 100644 shibsp/attribute/filtering/FilterPolicyContext.h create mode 100644 shibsp/attribute/filtering/FilteringContext.h create mode 100644 shibsp/attribute/filtering/MatchFunctor.h create mode 100644 shibsp/attribute/filtering/impl/AndMatchFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AnyMatchFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeFilter.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeScopeRegexFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeValueRegexFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/ChainingAttributeFilter.cpp create mode 100644 shibsp/attribute/filtering/impl/MatchFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/NotMatchFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/OrMatchFunctor.cpp create mode 100644 shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp create mode 100644 shibsp/attribute/resolver/AttributeExtractor.h create mode 100644 shibsp/attribute/resolver/AttributeResolver.h create mode 100644 shibsp/attribute/resolver/ResolutionContext.h create mode 100644 shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp create mode 100644 shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp create mode 100644 shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp create mode 100644 shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp create mode 100644 shibsp/base.h create mode 100644 shibsp/binding/ArtifactResolver.h create mode 100644 shibsp/binding/SOAPClient.h create mode 100644 shibsp/binding/impl/ArtifactResolver.cpp create mode 100644 shibsp/binding/impl/SOAPClient.cpp create mode 100644 shibsp/exceptions.h create mode 100644 shibsp/handler/AbstractHandler.h create mode 100644 shibsp/handler/AssertionConsumerService.h create mode 100644 shibsp/handler/Handler.h create mode 100644 shibsp/handler/LogoutHandler.h create mode 100644 shibsp/handler/RemotedHandler.h create mode 100644 shibsp/handler/SessionInitiator.h create mode 100644 shibsp/handler/impl/AbstractHandler.cpp create mode 100644 shibsp/handler/impl/AssertionConsumerService.cpp create mode 100644 shibsp/handler/impl/AssertionLookup.cpp create mode 100644 shibsp/handler/impl/ChainingLogoutInitiator.cpp create mode 100644 shibsp/handler/impl/ChainingSessionInitiator.cpp create mode 100644 shibsp/handler/impl/CookieSessionInitiator.cpp create mode 100644 shibsp/handler/impl/FormSessionInitiator.cpp create mode 100644 shibsp/handler/impl/LocalLogoutInitiator.cpp create mode 100644 shibsp/handler/impl/LogoutHandler.cpp create mode 100644 shibsp/handler/impl/MetadataGenerator.cpp create mode 100644 shibsp/handler/impl/RemotedHandler.cpp create mode 100644 shibsp/handler/impl/SAML1Consumer.cpp create mode 100644 shibsp/handler/impl/SAML2ArtifactResolution.cpp create mode 100644 shibsp/handler/impl/SAML2Consumer.cpp create mode 100644 shibsp/handler/impl/SAML2Logout.cpp create mode 100644 shibsp/handler/impl/SAML2LogoutInitiator.cpp create mode 100644 shibsp/handler/impl/SAML2NameIDMgmt.cpp create mode 100644 shibsp/handler/impl/SAML2SessionInitiator.cpp create mode 100644 shibsp/handler/impl/SAMLDSSessionInitiator.cpp create mode 100644 shibsp/handler/impl/SessionHandler.cpp create mode 100644 shibsp/handler/impl/SessionInitiator.cpp create mode 100644 shibsp/handler/impl/Shib1SessionInitiator.cpp create mode 100644 shibsp/handler/impl/StatusHandler.cpp create mode 100644 shibsp/handler/impl/TransformSessionInitiator.cpp create mode 100644 shibsp/handler/impl/WAYFSessionInitiator.cpp create mode 100644 shibsp/impl/StorageServiceSessionCache.cpp create mode 100644 shibsp/impl/XMLAccessControl.cpp create mode 100644 shibsp/impl/XMLRequestMapper.cpp create mode 100644 shibsp/impl/XMLServiceProvider.cpp create mode 100644 shibsp/internal.h create mode 100644 shibsp/lite/CommonDomainCookie.cpp create mode 100644 shibsp/lite/CommonDomainCookie.h create mode 100644 shibsp/lite/SAMLConstants.cpp create mode 100644 shibsp/lite/SAMLConstants.h create mode 100644 shibsp/metadata/MetadataExt.h create mode 100644 shibsp/metadata/MetadataExtImpl.cpp create mode 100644 shibsp/metadata/MetadataExtSchemaValidators.cpp create mode 100644 shibsp/paths.h create mode 100644 shibsp/paths.h.in create mode 100644 shibsp/remoting/ListenerService.h create mode 100644 shibsp/remoting/ddf.h create mode 100644 shibsp/remoting/impl/ListenerService.cpp create mode 100644 shibsp/remoting/impl/SocketListener.cpp create mode 100644 shibsp/remoting/impl/SocketListener.h create mode 100644 shibsp/remoting/impl/TCPListener.cpp create mode 100644 shibsp/remoting/impl/UnixListener.cpp create mode 100644 shibsp/remoting/impl/ddf.cpp create mode 100644 shibsp/resource.h create mode 100644 shibsp/security/PKIXTrustEngine.cpp create mode 100644 shibsp/security/PKIXTrustEngine.h create mode 100644 shibsp/security/SecurityPolicy.cpp create mode 100644 shibsp/security/SecurityPolicy.h create mode 100644 shibsp/shibsp-lite.vcproj create mode 100644 shibsp/shibsp.rc create mode 100644 shibsp/shibsp.vcproj create mode 100644 shibsp/util/CGIParser.cpp create mode 100644 shibsp/util/CGIParser.h create mode 100644 shibsp/util/DOMPropertySet.cpp create mode 100644 shibsp/util/DOMPropertySet.h create mode 100644 shibsp/util/PropertySet.h create mode 100644 shibsp/util/SPConstants.cpp create mode 100644 shibsp/util/SPConstants.h create mode 100644 shibsp/util/TemplateParameters.cpp create mode 100644 shibsp/util/TemplateParameters.h create mode 100644 shibsp/version.h create mode 100644 util/Makefile.am create mode 100644 util/Makefile.in create mode 100644 util/mdquery.cpp create mode 100644 util/mdquery.vcproj create mode 100644 util/resolvertest.cpp create mode 100644 util/resolvertest.vcproj diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..e6172ac --- /dev/null +++ b/Makefile.am @@ -0,0 +1,58 @@ +AUTOMAKE_OPTIONS = foreign + +ACLOCAL_AMFLAGS = -I . + +include doxygen.am + +MOSTLYCLEANFILES = $(DX_CLEANFILES) + +WANT_SUBDIRS = @WANT_SUBDIRS@ + +SUBDIRS = $(WANT_SUBDIRS) + +DIST_SUBDIRS = doc schemas configs shibsp shibd adfs util apache nsapi_shib fastcgi odbc-store selinux + +if DX_COND_doc +all-local: shibboleth.spec pkginfo doxygen-doc +APIDOCS = doc/api +else +all-local: shibboleth.spec pkginfo +endif + +install-data-hook: + rm -rf $(DESTDIR)$(datadir)/doc/@PACKAGE@/api + cp -r doc/api $(DESTDIR)$(datadir)/doc/@PACKAGE@ + +dist-hook: + rm -rf `find $(distdir)/isapi_shib -name .svn` + rm -rf `find $(distdir)/doc/api -name .svn` + +shibboleth.spec: shibboleth.spec.in Makefile + rm -f $@.tmp + sed < $< > $@.tmp \ + -e 's:@-VERSION-@:${VERSION}:' + mv $@.tmp $@ + +pkginfo: pkginfo.in Makefile + rm -f $@.tmp + sed < $< > $@.tmp \ + -e 's:@-VERSION-@:${VERSION}:' + mv $@.tmp $@ + +EXTRA_DIST = $(DX_CONFIG) \ + $(APIDOCS) \ + isapi_shib \ + Shibboleth.sln \ + libtool.m4 \ + doxygen.m4 \ + acx_pthread.m4 \ + depcomp \ + config_win32.h \ + shibboleth.spec.in \ + shibboleth.spec \ + pkginfo.in \ + pkginfo \ + depend \ + postinstall + +DISTCLEANFILES = shibboleth.spec pkginfo diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..cc1f613 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,858 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright (C) 2004 Oren Ben-Kiki +# This file is distributed under the same terms as the Automake macro files. + +# Generate automatic documentation using Doxygen. Goals and variables values +# are controlled by the various DX_COND_??? conditionals set by autoconf. +# +# The provided goals are: +# doxygen-doc: Generate all doxygen documentation. +# doxygen-run: Run doxygen, which will generate some of the documentation +# (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post +# processing required for the rest of it (PS, PDF, and some MAN). +# doxygen-man: Rename some doxygen generated man pages. +# doxygen-ps: Generate doxygen PostScript documentation. +# doxygen-pdf: Generate doxygen PDF documentation. +# +# Note that by default these are not integrated into the automake goals. If +# doxygen is used to generate man pages, you can achieve this integration by +# setting man3_MANS to the list of man pages generated and then adding the +# dependency: +# +# $(man3_MANS): doxygen-doc +# +# This will cause make to run doxygen and generate all the documentation. +# +# The following variable is intended for use in Makefile.am: +# +# DX_CLEANFILES = everything to clean. +# +# This is usually added to MOSTLYCLEANFILES. +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/doxygen.am $(top_srcdir)/configure config.guess \ + config.sub depcomp install-sh ltmain.sh missing mkinstalldirs +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I . +@DX_COND_doc_TRUE@@DX_COND_html_TRUE@DX_CLEAN_HTML = @DX_DOCDIR@/html +@DX_COND_chm_TRUE@@DX_COND_doc_TRUE@DX_CLEAN_CHM = @DX_DOCDIR@/chm +@DX_COND_chi_TRUE@@DX_COND_chm_TRUE@@DX_COND_doc_TRUE@DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi +@DX_COND_doc_TRUE@@DX_COND_man_TRUE@DX_CLEAN_MAN = @DX_DOCDIR@/man +@DX_COND_doc_TRUE@@DX_COND_rtf_TRUE@DX_CLEAN_RTF = @DX_DOCDIR@/rtf +@DX_COND_doc_TRUE@@DX_COND_xml_TRUE@DX_CLEAN_XML = @DX_DOCDIR@/xml +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@DX_PS_GOAL = doxygen-ps +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@DX_PDF_GOAL = doxygen-pdf +@DX_COND_doc_TRUE@@DX_COND_latex_TRUE@DX_CLEAN_LATEX = @DX_DOCDIR@/latex +@DX_COND_doc_TRUE@DX_CLEANFILES = \ +@DX_COND_doc_TRUE@ @DX_DOCDIR@/@PACKAGE@.tag \ +@DX_COND_doc_TRUE@ -r \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_HTML) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_CHM) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_CHI) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_MAN) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_RTF) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_XML) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_PS) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_PDF) \ +@DX_COND_doc_TRUE@ $(DX_CLEAN_LATEX) + +MOSTLYCLEANFILES = $(DX_CLEANFILES) +SUBDIRS = $(WANT_SUBDIRS) +DIST_SUBDIRS = doc schemas configs shibsp shibd adfs util apache nsapi_shib fastcgi odbc-store selinux +@DX_COND_doc_TRUE@APIDOCS = doc/api +EXTRA_DIST = $(DX_CONFIG) \ + $(APIDOCS) \ + isapi_shib \ + Shibboleth.sln \ + libtool.m4 \ + doxygen.m4 \ + acx_pthread.m4 \ + depcomp \ + config_win32.h \ + shibboleth.spec.in \ + shibboleth.spec \ + pkginfo.in \ + pkginfo \ + depend \ + postinstall + +DISTCLEANFILES = shibboleth.spec pkginfo +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/doxygen.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/doc + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h all-local +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local \ + am--refresh check check-am clean clean-generic clean-libtool \ + clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-generic distclean-hdr distclean-libtool \ + distclean-recursive distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-hook install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + + +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps + +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ cd @DX_DOCDIR@/latex; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ $(DX_LATEX) refman.tex; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ $(MAKEINDEX_PATH) refman.idx; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ $(DX_LATEX) refman.tex; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ countdown=5; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ refman.log > /dev/null 2>&1 \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ && test $$countdown -gt 0; do \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ $(DX_LATEX) refman.tex; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ countdown=`expr $$countdown - 1`; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ done; \ +@DX_COND_doc_TRUE@@DX_COND_ps_TRUE@ $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi + +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf + +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ cd @DX_DOCDIR@/latex; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ $(DX_PDFLATEX) refman.tex; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ $(DX_MAKEINDEX) refman.idx; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ $(DX_PDFLATEX) refman.tex; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ countdown=5; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ refman.log > /dev/null 2>&1 \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ && test $$countdown -gt 0; do \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ $(DX_PDFLATEX) refman.tex; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ countdown=`expr $$countdown - 1`; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ done; \ +@DX_COND_doc_TRUE@@DX_COND_pdf_TRUE@ mv refman.pdf ../@PACKAGE@.pdf + +@DX_COND_doc_TRUE@.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) + +@DX_COND_doc_TRUE@.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) + +@DX_COND_doc_TRUE@doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag + +@DX_COND_doc_TRUE@doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) + +@DX_COND_doc_TRUE@@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) +@DX_COND_doc_TRUE@ rm -rf @DX_DOCDIR@ +@DX_COND_doc_TRUE@ $(DX_ENV) DX_INCLUDE=$(DX_INCLUDE) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) + +@DX_COND_doc_TRUE@all-local: shibboleth.spec pkginfo doxygen-doc +@DX_COND_doc_FALSE@all-local: shibboleth.spec pkginfo + +install-data-hook: + rm -rf $(DESTDIR)$(datadir)/doc/@PACKAGE@/api + cp -r doc/api $(DESTDIR)$(datadir)/doc/@PACKAGE@ + +dist-hook: + rm -rf `find $(distdir)/isapi_shib -name .svn` + rm -rf `find $(distdir)/doc/api -name .svn` + +shibboleth.spec: shibboleth.spec.in Makefile + rm -f $@.tmp + sed < $< > $@.tmp \ + -e 's:@-VERSION-@:${VERSION}:' + mv $@.tmp $@ + +pkginfo: pkginfo.in Makefile + rm -f $@.tmp + sed < $< > $@.tmp \ + -e 's:@-VERSION-@:${VERSION}:' + mv $@.tmp $@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Shibboleth.sln b/Shibboleth.sln new file mode 100644 index 0000000..c4616c3 --- /dev/null +++ b/Shibboleth.sln @@ -0,0 +1,238 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isapi_shib", "isapi_shib\isapi_shib.vcproj", "{87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib13", "apache\mod_shib13.vcproj", "{D243B43E-728E-4F32-BDFF-B3A897037C6D}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib20", "apache\mod_shib20.vcproj", "{68E9568B-476C-4289-B93C-893432378ADC}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsapi_shib", "nsapi_shib\nsapi_shib.vcproj", "{1396D80A-8672-4224-9B02-95F3F4207CDB}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib22", "apache\mod_shib22.vcproj", "{B44C0852-83B8-4FB2-A86E-097C9C8256D0}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server Modules", "Server Modules", "{26BA8F84-6E42-41FA-9B13-5D3F4B5B2050}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{FED80230-119E-4B2F-9F53-D2660A5F022B}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "odbc-store", "odbc-store\odbc-store.vcproj", "{666A63A7-983F-4C19-8411-207F24305197}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibsp", "shibsp\shibsp.vcproj", "{81F0F7A6-DC36-46EF-957F-F9E81D4403F6}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibd", "shibd\shibd.vcproj", "{F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibsp-lite", "shibsp\shibsp-lite.vcproj", "{81F0F7A6-DC36-46EF-957F-F9E81D4403F7}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adfs", "adfs\adfs.vcproj", "{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adfs-lite", "adfs\adfs-lite.vcproj", "{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdquery", "util\mdquery.vcproj", "{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "resolvertest", "util\resolvertest.vcproj", "{F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fastcgi", "fastcgi", "{8E1AF2CF-24E1-4983-8681-394D89DF9AD2}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibauthorizer", "fastcgi\shibauthorizer.vcproj", "{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibresponder", "fastcgi\shibresponder.vcproj", "{B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Debug|Win32.ActiveCfg = Debug|Win32 + {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Debug|Win32.Build.0 = Debug|Win32 + {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Release|Win32.ActiveCfg = Release|Win32 + {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Release|Win32.Build.0 = Release|Win32 + {D243B43E-728E-4F32-BDFF-B3A897037C6D}.Debug|Win32.ActiveCfg = Debug|Win32 + {D243B43E-728E-4F32-BDFF-B3A897037C6D}.Debug|Win32.Build.0 = Debug|Win32 + {D243B43E-728E-4F32-BDFF-B3A897037C6D}.Release|Win32.ActiveCfg = Release|Win32 + {D243B43E-728E-4F32-BDFF-B3A897037C6D}.Release|Win32.Build.0 = Release|Win32 + {68E9568B-476C-4289-B93C-893432378ADC}.Debug|Win32.ActiveCfg = Debug|Win32 + {68E9568B-476C-4289-B93C-893432378ADC}.Debug|Win32.Build.0 = Debug|Win32 + {68E9568B-476C-4289-B93C-893432378ADC}.Release|Win32.ActiveCfg = Release|Win32 + {68E9568B-476C-4289-B93C-893432378ADC}.Release|Win32.Build.0 = Release|Win32 + {1396D80A-8672-4224-9B02-95F3F4207CDB}.Debug|Win32.ActiveCfg = Debug|Win32 + {1396D80A-8672-4224-9B02-95F3F4207CDB}.Debug|Win32.Build.0 = Debug|Win32 + {1396D80A-8672-4224-9B02-95F3F4207CDB}.Release|Win32.ActiveCfg = Release|Win32 + {1396D80A-8672-4224-9B02-95F3F4207CDB}.Release|Win32.Build.0 = Release|Win32 + {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Debug|Win32.Build.0 = Debug|Win32 + {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Release|Win32.ActiveCfg = Release|Win32 + {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Release|Win32.Build.0 = Release|Win32 + {666A63A7-983F-4C19-8411-207F24305197}.Debug|Win32.ActiveCfg = Debug|Win32 + {666A63A7-983F-4C19-8411-207F24305197}.Debug|Win32.Build.0 = Debug|Win32 + {666A63A7-983F-4C19-8411-207F24305197}.Release|Win32.ActiveCfg = Release|Win32 + {666A63A7-983F-4C19-8411-207F24305197}.Release|Win32.Build.0 = Release|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Debug|Win32.ActiveCfg = Debug|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Debug|Win32.Build.0 = Debug|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Release|Win32.ActiveCfg = Release|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Release|Win32.Build.0 = Release|Win32 + {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.ActiveCfg = Debug|Win32 + {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.Build.0 = Debug|Win32 + {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.ActiveCfg = Release|Win32 + {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.Build.0 = Release|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Debug|Win32.ActiveCfg = Debug|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Debug|Win32.Build.0 = Debug|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Release|Win32.ActiveCfg = Release|Win32 + {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Release|Win32.Build.0 = Release|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Debug|Win32.ActiveCfg = Debug|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Debug|Win32.Build.0 = Debug|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Release|Win32.ActiveCfg = Release|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Release|Win32.Build.0 = Release|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Debug|Win32.ActiveCfg = Debug|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Debug|Win32.Build.0 = Debug|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|Win32.ActiveCfg = Release|Win32 + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|Win32.Build.0 = Release|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|Win32.ActiveCfg = Debug|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|Win32.Build.0 = Debug|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|Win32.ActiveCfg = Release|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|Win32.Build.0 = Release|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.ActiveCfg = Debug|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.Build.0 = Debug|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.ActiveCfg = Release|Win32 + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.Build.0 = Release|Win32 + {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Debug|Win32.ActiveCfg = Debug|Win32 + {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Debug|Win32.Build.0 = Debug|Win32 + {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Release|Win32.ActiveCfg = Release|Win32 + {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Release|Win32.Build.0 = Release|Win32 + {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Debug|Win32.ActiveCfg = Debug|Win32 + {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Debug|Win32.Build.0 = Debug|Win32 + {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Release|Win32.ActiveCfg = Release|Win32 + {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D243B43E-728E-4F32-BDFF-B3A897037C6D} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050} + {68E9568B-476C-4289-B93C-893432378ADC} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050} + {1396D80A-8672-4224-9B02-95F3F4207CDB} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050} + {B44C0852-83B8-4FB2-A86E-097C9C8256D0} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050} + {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050} + {8E1AF2CF-24E1-4983-8681-394D89DF9AD2} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050} + {666A63A7-983F-4C19-8411-207F24305197} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C} + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C} + {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C} + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A} = {FED80230-119E-4B2F-9F53-D2660A5F022B} + {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59} = {FED80230-119E-4B2F-9F53-D2660A5F022B} + {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0} = {8E1AF2CF-24E1-4983-8681-394D89DF9AD2} + {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25} = {8E1AF2CF-24E1-4983-8681-394D89DF9AD2} + EndGlobalSection +EndGlobal diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..4c27c15 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,90 @@ +dnl @synopsis AC_CXX_NAMESPACES +dnl +dnl If the compiler can prevent names clashes using namespaces, define +dnl HAVE_NAMESPACES. +dnl +dnl @author Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_NAMESPACES], +[AC_CACHE_CHECK(whether the compiler implements namespaces, +ac_cv_cxx_namespaces, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], + [using namespace Outer::Inner; return i;], + ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_namespaces" = yes; then + AC_DEFINE(HAVE_NAMESPACES,1,[define if the compiler implements namespaces]) +fi +]) + + +dnl +dnl @author Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_REQUIRE_STL], +[AC_CACHE_CHECK(whether the compiler supports Standard Template Library, +ac_cv_cxx_have_stl, +[AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif],[list x; x.push_back(5); +list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;], + ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no) + AC_LANG_RESTORE +]) +if test "x_$ac_cv_cxx_have_stl" != x_yes; then + AC_MSG_ERROR([C++ Standard Template Libary unsupported]) +fi +]) + +dnl@synopsys YAD_CHECK_INCLUDE_LIB(INCLUDE, LIBRARY, CODE +dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND +dnl [, OTHER-LIBRARIES]]]) +dnl +dnl same as the AC_CHECK_LIB except of the following: +dnl - You sholud specify include part of test. +dnl - You can test any code for linking, not just function calls. +dnl +dnl@author Alexandr Yanovets +dnl +AC_DEFUN(YAD_CHECK_INCLUDE_LIB, +[AC_MSG_CHECKING([for $3 in -l$2]) +dnl Use a cache variable name containing both the library and function name, +dnl because the test really is for library $2 defining function $3, not +dnl just for library $2. Separate tests with the same $2 and different $3s +dnl may have different results. +ac_lib_var=`echo $2['_']include | sed 'y%./+-%__p_%'` +AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, +[yad_check_lib_save_LIBS="$LIBS" +LIBS="-l$2 $6 $LIBS" +AC_TRY_LINK(dnl + [$1], + [$3], + eval "ac_cv_lib_$ac_lib_var=yes", + eval "ac_cv_lib_$ac_lib_var=no") +LIBS="$yad_check_lib_save_LIBS" +])dnl +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$4], , +[changequote(, )dnl + ac_tr_lib=HAVE_LIB`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_lib) + LIBS="-l$2 $LIBS" +], [$4]) +else + AC_MSG_RESULT(no) +ifelse([$5], , , [$5 +])dnl +fi +]) + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..14e140e --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,864 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([libtool.m4]) +m4_include([acinclude.m4]) diff --git a/acx_pthread.m4 b/acx_pthread.m4 new file mode 100644 index 0000000..33f1d29 --- /dev/null +++ b/acx_pthread.m4 @@ -0,0 +1,287 @@ +##### http://autoconf-archive.cryp.to/acx_pthread.html +# +# SYNOPSIS +# +# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. +# It sets the PTHREAD_LIBS output variable to the threads library and +# linker flags, and the PTHREAD_CFLAGS output variable to any special +# C compiler flags that are needed. (The user can also force certain +# compiler flags/libs to be tested by setting these environment +# variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). +# (This is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these +# flags, but also link it with them as well. e.g. you should link +# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS +# $LIBS +# +# If you are only building threads programs, you may wish to use +# these variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute +# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads +# library is found, and ACTION-IF-NOT-FOUND is a list of commands to +# run it if it is not found. If ACTION-IF-FOUND is not specified, the +# default action will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or +# if you have any other suggestions or comments. This macro was based +# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) +# (with help from M. Frigo), as well as ac_pthread and hb_pthread +# macros posted by Alejandro Forero Cuervo to the autoconf macro +# repository. We are also grateful for the helpful feedback of +# numerous users. +# +# LAST MODIFICATION +# +# 2006-05-29 +# +# COPYLEFT +# +# Copyright (c) 2006 Steven G. Johnson +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_TRY_LINK([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], + [acx_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_TRY_LINK([#include ], [int attr=$attr; return attr;], + [attr_name=$attr; break]) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; + *-osf* | *-hpux*) flag="-D_REENTRANT";; + *solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl ACX_PTHREAD diff --git a/adfs/Makefile.am b/adfs/Makefile.am new file mode 100644 index 0000000..82913b5 --- /dev/null +++ b/adfs/Makefile.am @@ -0,0 +1,25 @@ +AUTOMAKE_OPTIONS = foreign + +plugindir = $(libdir)/@PACKAGE@ +plugin_LTLIBRARIES = adfs.la adfs-lite.la + +adfs_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp.la + +adfs_la_SOURCES = \ + adfs.cpp + +adfs_lite_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +adfs_lite_la_SOURCES = \ + adfs.cpp + +adfs_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS) +adfs_lite_la_LDFLAGS = -module -avoid-version $(LITE_LIBS) +adfs_lite_la_CPPFLAGS = -DSHIBSP_LITE + +install-exec-hook: + for la in $(plugin_LTLIBRARIES) ; do rm -f $(DESTDIR)$(plugindir)/$$la ; done + +EXTRA_DIST = adfs.vcproj adfs-lite.vcproj resource.h adfs.rc diff --git a/adfs/Makefile.in b/adfs/Makefile.in new file mode 100644 index 0000000..0335f39 --- /dev/null +++ b/adfs/Makefile.in @@ -0,0 +1,581 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = adfs +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(plugindir)" +pluginLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(plugin_LTLIBRARIES) +adfs_lite_la_DEPENDENCIES = $(top_builddir)/shibsp/libshibsp-lite.la +am_adfs_lite_la_OBJECTS = adfs_lite_la-adfs.lo +adfs_lite_la_OBJECTS = $(am_adfs_lite_la_OBJECTS) +adfs_la_DEPENDENCIES = $(top_builddir)/shibsp/libshibsp.la +am_adfs_la_OBJECTS = adfs.lo +adfs_la_OBJECTS = $(am_adfs_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(adfs_lite_la_SOURCES) $(adfs_la_SOURCES) +DIST_SOURCES = $(adfs_lite_la_SOURCES) $(adfs_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +plugindir = $(libdir)/@PACKAGE@ +plugin_LTLIBRARIES = adfs.la adfs-lite.la +adfs_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp.la + +adfs_la_SOURCES = \ + adfs.cpp + +adfs_lite_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +adfs_lite_la_SOURCES = \ + adfs.cpp + +adfs_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS) +adfs_lite_la_LDFLAGS = -module -avoid-version $(LITE_LIBS) +adfs_lite_la_CPPFLAGS = -DSHIBSP_LITE +EXTRA_DIST = adfs.vcproj adfs-lite.vcproj resource.h adfs.rc +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign adfs/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign adfs/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(plugindir)" || $(mkdir_p) "$(DESTDIR)$(plugindir)" + @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(plugindir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$p"; \ + done + +clean-pluginLTLIBRARIES: + -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) + @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +adfs-lite.la: $(adfs_lite_la_OBJECTS) $(adfs_lite_la_DEPENDENCIES) + $(CXXLINK) -rpath $(plugindir) $(adfs_lite_la_LDFLAGS) $(adfs_lite_la_OBJECTS) $(adfs_lite_la_LIBADD) $(LIBS) +adfs.la: $(adfs_la_OBJECTS) $(adfs_la_DEPENDENCIES) + $(CXXLINK) -rpath $(plugindir) $(adfs_la_LDFLAGS) $(adfs_la_OBJECTS) $(adfs_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adfs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adfs_lite_la-adfs.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +adfs_lite_la-adfs.lo: adfs.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adfs_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT adfs_lite_la-adfs.lo -MD -MP -MF "$(DEPDIR)/adfs_lite_la-adfs.Tpo" -c -o adfs_lite_la-adfs.lo `test -f 'adfs.cpp' || echo '$(srcdir)/'`adfs.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/adfs_lite_la-adfs.Tpo" "$(DEPDIR)/adfs_lite_la-adfs.Plo"; else rm -f "$(DEPDIR)/adfs_lite_la-adfs.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='adfs.cpp' object='adfs_lite_la-adfs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adfs_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o adfs_lite_la-adfs.lo `test -f 'adfs.cpp' || echo '$(srcdir)/'`adfs.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(plugindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginLTLIBRARIES + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pluginLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-exec-hook install-info install-info-am \ + install-man install-pluginLTLIBRARIES install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-pluginLTLIBRARIES + + +install-exec-hook: + for la in $(plugin_LTLIBRARIES) ; do rm -f $(DESTDIR)$(plugindir)/$$la ; done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/adfs/adfs-lite.vcproj b/adfs/adfs-lite.vcproj new file mode 100644 index 0000000..175e433 --- /dev/null +++ b/adfs/adfs-lite.vcproj @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/adfs/adfs.cpp b/adfs/adfs.cpp new file mode 100644 index 0000000..b900bdc --- /dev/null +++ b/adfs/adfs.cpp @@ -0,0 +1,899 @@ +/* + * Copyright 2001-2005 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * adfs.cpp + * + * ADFSv1 extension library + */ + +#if defined (_MSC_VER) || defined(__BORLANDC__) +# include "config_win32.h" +#else +# include "config.h" +#endif + +#ifdef WIN32 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +# define _CRT_SECURE_NO_DEPRECATE 1 +# define ADFS_EXPORTS __declspec(dllexport) +#else +# define ADFS_EXPORTS +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SHIBSP_LITE +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +using namespace opensaml::saml2md; +# ifndef min +# define min(a,b) (((a) < (b)) ? (a) : (b)) +# endif +#endif +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling::logging; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +#define WSFED_NS "http://schemas.xmlsoap.org/ws/2003/07/secext" +#define WSTRUST_NS "http://schemas.xmlsoap.org/ws/2005/02/trust" + +namespace { + +#ifndef SHIBSP_LITE + class SHIBSP_DLLLOCAL ADFSDecoder : public MessageDecoder + { + auto_ptr_XMLCh m_ns; + public: + ADFSDecoder() : m_ns(WSTRUST_NS) {} + virtual ~ADFSDecoder() {} + + XMLObject* decode(string& relayState, const GenericRequest& genericRequest, SecurityPolicy& policy) const; + + protected: + void extractMessageDetails( + const XMLObject& message, const GenericRequest& req, const XMLCh* protocol, SecurityPolicy& policy + ) const { + } + }; + + MessageDecoder* ADFSDecoderFactory(const pair& p) + { + return new ADFSDecoder(); + } +#endif + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL ADFSSessionInitiator : public SessionInitiator, public AbstractHandler, public RemotedHandler + { + public: + ADFSSessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.ADFS")), m_appId(appId), m_binding(WSFED_NS) { + // If Location isn't set, defer address registration until the setParent call. + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::ADFSSI"; + setAddress(address.c_str()); + } + } + virtual ~ADFSSessionInitiator() {} + + void setParent(const PropertySet* parent) { + DOMPropertySet::setParent(parent); + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::ADFSSI"; + setAddress(address.c_str()); + } + else { + m_log.warn("no Location property in ADFS SessionInitiator (or parent), can't register as remoted handler"); + } + } + + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + + private: + pair doRequest( + const Application& application, + HTTPResponse& httpResponse, + const char* entityID, + const char* acsLocation, + const char* authnContextClassRef, + string& relayState + ) const; + string m_appId; + auto_ptr_XMLCh m_binding; + }; + + class SHIBSP_DLLLOCAL ADFSConsumer : public shibsp::AssertionConsumerService + { + public: + ADFSConsumer(const DOMElement* e, const char* appId) + : shibsp::AssertionConsumerService(e, appId, Category::getInstance(SHIBSP_LOGCAT".SSO.ADFS")) +#ifndef SHIBSP_LITE + ,m_protocol(WSFED_NS) +#endif + {} + virtual ~ADFSConsumer() {} + +#ifndef SHIBSP_LITE + void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + AssertionConsumerService::generateMetadata(role, handlerURL); + role.addSupport(m_protocol.get()); + } + + auto_ptr_XMLCh m_protocol; + + private: + void implementProtocol( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + SecurityPolicy& policy, + const PropertySet* settings, + const XMLObject& xmlObject + ) const; +#endif + }; + + class SHIBSP_DLLLOCAL ADFSLogoutInitiator : public AbstractHandler, public RemotedHandler + { + public: + ADFSLogoutInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".LogoutInitiator.ADFS")), m_appId(appId), m_binding(WSFED_NS) { + // If Location isn't set, defer address registration until the setParent call. + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::ADFSLI"; + setAddress(address.c_str()); + } + } + virtual ~ADFSLogoutInitiator() {} + + void setParent(const PropertySet* parent) { + DOMPropertySet::setParent(parent); + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::ADFSLI"; + setAddress(address.c_str()); + } + else { + m_log.warn("no Location property in ADFS LogoutInitiator (or parent), can't register as remoted handler"); + } + } + + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + const char* getType() const { + return "LogoutInitiator"; + } +#endif + + private: + pair doRequest(const Application& application, const char* entityID, HTTPResponse& httpResponse) const; + + string m_appId; + auto_ptr_XMLCh m_binding; + }; + + class SHIBSP_DLLLOCAL ADFSLogout : public AbstractHandler, public LogoutHandler + { + public: + ADFSLogout(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".Logout.ADFS")), m_login(e, appId) { +#ifndef SHIBSP_LITE + m_initiator = false; + m_preserve.push_back("wreply"); + string address = string(appId) + getString("Location").second + "::run::ADFSLO"; + setAddress(address.c_str()); +#endif + } + virtual ~ADFSLogout() {} + + pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + m_login.generateMetadata(role, handlerURL); + const char* loc = getString("Location").second; + string hurl(handlerURL); + if (*loc != '/') + hurl += '/'; + hurl += loc; + auto_ptr_XMLCh widen(hurl.c_str()); + SingleLogoutService* ep = SingleLogoutServiceBuilder::buildSingleLogoutService(); + ep->setLocation(widen.get()); + ep->setBinding(m_login.m_protocol.get()); + role.getSingleLogoutServices().push_back(ep); + } + + const char* getType() const { + return m_login.getType(); + } +#endif + + private: + ADFSConsumer m_login; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* ADFSSessionInitiatorFactory(const pair& p) + { + return new ADFSSessionInitiator(p.first, p.second); + } + + Handler* ADFSLogoutFactory(const pair& p) + { + return new ADFSLogout(p.first, p.second); + } + + Handler* ADFSLogoutInitiatorFactory(const pair& p) + { + return new ADFSLogoutInitiator(p.first, p.second); + } + + const XMLCh RequestedSecurityToken[] = UNICODE_LITERAL_22(R,e,q,u,e,s,t,e,d,S,e,c,u,r,i,t,y,T,o,k,e,n); + const XMLCh RequestSecurityTokenResponse[] =UNICODE_LITERAL_28(R,e,q,u,e,s,t,S,e,c,u,r,i,t,y,T,o,k,e,n,R,e,s,p,o,n,s,e); +}; + +extern "C" int ADFS_EXPORTS xmltooling_extension_init(void*) +{ + SPConfig& conf=SPConfig::getConfig(); + conf.SessionInitiatorManager.registerFactory("ADFS", ADFSSessionInitiatorFactory); + conf.LogoutInitiatorManager.registerFactory("ADFS", ADFSLogoutInitiatorFactory); + conf.AssertionConsumerServiceManager.registerFactory("ADFS", ADFSLogoutFactory); + conf.AssertionConsumerServiceManager.registerFactory(WSFED_NS, ADFSLogoutFactory); +#ifndef SHIBSP_LITE + SAMLConfig::getConfig().MessageDecoderManager.registerFactory(WSFED_NS, ADFSDecoderFactory); + XMLObjectBuilder::registerBuilder(QName(WSTRUST_NS,"RequestedSecurityToken"), new AnyElementBuilder()); + XMLObjectBuilder::registerBuilder(QName(WSTRUST_NS,"RequestSecurityTokenResponse"), new AnyElementBuilder()); +#endif + return 0; +} + +extern "C" void ADFS_EXPORTS xmltooling_extension_term() +{ + /* should get unregistered during normal shutdown... + SPConfig& conf=SPConfig::getConfig(); + conf.SessionInitiatorManager.deregisterFactory("ADFS"); + conf.LogoutInitiatorManager.deregisterFactory("ADFS"); + conf.AssertionConsumerServiceManager.deregisterFactory("ADFS"); + conf.AssertionConsumerServiceManager.deregisterFactory(WSFED_NS); +#ifndef SHIBSP_LITE + SAMLConfig::getConfig().MessageDecoderManager.deregisterFactory(WSFED_NS); +#endif + */ +} + +pair ADFSSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + // We have to know the IdP to function. + if (entityID.empty()) + return make_pair(false,0L); + + string target; + const Handler* ACS=NULL; + const char* option; + pair acClass; + const Application& app=request.getApplication(); + + if (isHandler) { + option = request.getParameter("target"); + if (option) + target = option; + + // Since we're passing the ACS by value, we need to compute the return URL, + // so we'll need the target resource for real. + recoverRelayState(request.getApplication(), request, request, target, false); + + if (acClass.second = request.getParameter("authnContextClassRef")) + acClass.first = true; + else + acClass = getString("authnContextClassRef"); + } + else { + // We're running as a "virtual handler" from within the filter. + // The target resource is the current one and everything else is defaulted. + target=request.getRequestURL(); + + const PropertySet* settings = request.getRequestSettings().first; + acClass = settings->getString("authnContextClassRef"); + if (!acClass.first) + acClass = getString("authnContextClassRef"); + } + + // Since we're not passing by index, we need to fully compute the return URL. + // Get all the ADFS endpoints. + const vector& handlers = app.getAssertionConsumerServicesByBinding(m_binding.get()); + + // Index comes from request, or default set in the handler, or we just pick the first endpoint. + pair index(false,0); + if (isHandler) { + option = request.getParameter("acsIndex"); + if (option) + index = pair(true, atoi(option)); + } + if (!index.first) + index = getUnsignedInt("defaultACSIndex"); + if (index.first) { + for (vector::const_iterator h = handlers.begin(); !ACS && h!=handlers.end(); ++h) { + if (index.second == (*h)->getUnsignedInt("index").second) + ACS = *h; + } + } + else if (!handlers.empty()) { + ACS = handlers.front(); + } + if (!ACS) + throw ConfigurationException("Unable to locate ADFS response endpoint."); + + // Compute the ACS URL. We add the ACS location to the base handlerURL. + string ACSloc=request.getHandlerURL(target.c_str()); + pair loc=ACS ? ACS->getString("Location") : pair(false,NULL); + if (loc.first) ACSloc+=loc.second; + + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + target.erase(); + option = request.getParameter("target"); + if (option) + target = option; + } + + m_log.debug("attempting to initiate session using ADFS with provider (%s)", entityID.c_str()); + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) + return doRequest(app, request, entityID.c_str(), ACSloc.c_str(), (acClass.first ? acClass.second : NULL), target); + + // Remote the call. + DDF out,in = DDF(m_address.c_str()).structure(); + DDFJanitor jin(in), jout(out); + in.addmember("application_id").string(app.getId()); + in.addmember("entity_id").string(entityID.c_str()); + in.addmember("acsLocation").string(ACSloc.c_str()); + if (!target.empty()) + in.addmember("RelayState").string(target.c_str()); + if (acClass.first) + in.addmember("authnContextClassRef").string(acClass.second); + + // Remote the processing. + out = request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); +} + +void ADFSSessionInitiator::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) to generate ADFS request", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for new session, deleted?"); + } + + const char* entityID = in["entity_id"].string(); + const char* acsLocation = in["acsLocation"].string(); + if (!entityID || !acsLocation) + throw ConfigurationException("No entityID or acsLocation parameter supplied to remoted SessionInitiator."); + + DDF ret(NULL); + DDFJanitor jout(ret); + + // Wrap the outgoing object with a Response facade. + auto_ptr http(getResponse(ret)); + + string relayState(in["RelayState"].string() ? in["RelayState"].string() : ""); + + // Since we're remoted, the result should either be a throw, which we pass on, + // a false/0 return, which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + doRequest(*app, *http.get(), entityID, acsLocation, in["authnContextClassRef"].string(), relayState); + out << ret; +} + +pair ADFSSessionInitiator::doRequest( + const Application& app, + HTTPResponse& httpResponse, + const char* entityID, + const char* acsLocation, + const char* authnContextClassRef, + string& relayState + ) const +{ +#ifndef SHIBSP_LITE + // Use metadata to invoke the SSO service directly. + MetadataProvider* m=app.getMetadataProvider(); + Locker locker(m); + MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, m_binding.get()); + pair entity=m->getEntityDescriptor(mc); + if (!entity.first) { + m_log.warn("unable to locate metadata for provider (%s)", entityID); + throw MetadataException("Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", entityID)); + } + else if (!entity.second) { + m_log.warn("unable to locate ADFS-aware identity provider role for provider (%s)", entityID); + if (getParent()) + return make_pair(false,0L); + throw MetadataException("Unable to locate ADFS-aware identity provider role for provider ($entityID)", namedparams(1, "entityID", entityID)); + } + const EndpointType* ep = EndpointManager( + dynamic_cast(entity.second)->getSingleSignOnServices() + ).getByBinding(m_binding.get()); + if (!ep) { + m_log.warn("unable to locate compatible SSO service for provider (%s)", entityID); + if (getParent()) + return make_pair(false,0L); + throw MetadataException("Unable to locate compatible SSO service for provider ($entityID)", namedparams(1, "entityID", entityID)); + } + + preserveRelayState(app, httpResponse, relayState); + + // UTC timestamp + time_t epoch=time(NULL); +#ifndef HAVE_GMTIME_R + struct tm* ptime=gmtime(&epoch); +#else + struct tm res; + struct tm* ptime=gmtime_r(&epoch,&res); +#endif + char timebuf[32]; + strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime); + + auto_ptr_char dest(ep->getLocation()); + const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder(); + + string req=string(dest.get()) + (strchr(dest.get(),'?') ? '&' : '?') + "wa=wsignin1.0&wreply=" + urlenc->encode(acsLocation) + + "&wct=" + urlenc->encode(timebuf) + "&wtrealm=" + urlenc->encode(app.getString("entityID").second); + if (authnContextClassRef) + req += "&wauth=" + urlenc->encode(authnContextClassRef); + if (!relayState.empty()) + req += "&wctx=" + urlenc->encode(relayState.c_str()); + + return make_pair(true, httpResponse.sendRedirect(req.c_str())); +#else + return make_pair(false,0L); +#endif +} + +#ifndef SHIBSP_LITE + +XMLObject* ADFSDecoder::decode(string& relayState, const GenericRequest& genericRequest, SecurityPolicy& policy) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("decode"); +#endif + Category& log = Category::getInstance(SHIBSP_LOGCAT".MessageDecoder.ADFS"); + + log.debug("validating input"); + const HTTPRequest* httpRequest=dynamic_cast(&genericRequest); + if (!httpRequest) + throw BindingException("Unable to cast request object to HTTPRequest type."); + if (strcmp(httpRequest->getMethod(),"POST")) + throw BindingException("Invalid HTTP method ($1).", params(1, httpRequest->getMethod())); + const char* param = httpRequest->getParameter("wa"); + if (!param || strcmp(param, "wsignin1.0")) + throw BindingException("Missing or invalid wa parameter (should be wsignin1.0)."); + param = httpRequest->getParameter("wctx"); + if (param) + relayState = param; + + param = httpRequest->getParameter("wresult"); + if (!param) + throw BindingException("Request missing wresult parameter."); + + log.debug("decoded ADFS response:\n%s", param); + + // Parse and bind the document into an XMLObject. + istringstream is(param); + DOMDocument* doc = (policy.getValidating() ? XMLToolingConfig::getConfig().getValidatingParser() + : XMLToolingConfig::getConfig().getParser()).parse(is); + XercesJanitor janitor(doc); + auto_ptr xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true)); + janitor.release(); + + if (!XMLHelper::isNodeNamed(xmlObject->getDOM(), m_ns.get(), RequestSecurityTokenResponse)) + throw BindingException("Decoded message was not of the appropriate type."); + + if (!policy.getValidating()) + SchemaValidators.validate(xmlObject.get()); + + // Skip policy step here, there's no security in the wrapper. + // policy.evaluate(*xmlObject.get(), &genericRequest); + + return xmlObject.release(); +} + +void ADFSConsumer::implementProtocol( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + SecurityPolicy& policy, + const PropertySet* settings, + const XMLObject& xmlObject + ) const +{ + // Implementation of ADFS profile. + m_log.debug("processing message against ADFS Passive Requester profile"); + + // With ADFS, all the security comes from the assertion, which is two levels down in the message. + + const ElementProxy* response = dynamic_cast(&xmlObject); + if (!response || !response->hasChildren()) + throw FatalProfileException("Incoming message was not of the proper type or contains no security token."); + response = dynamic_cast(response->getUnknownXMLObjects().front()); + if (!response || !response->hasChildren()) + throw FatalProfileException("Token wrapper element did not contain a security token."); + const Assertion* token = dynamic_cast(response->getUnknownXMLObjects().front()); + if (!token || !token->getSignature()) + throw FatalProfileException("Incoming message did not contain a signed SAML assertion."); + + // Extract message and issuer details from assertion. + extractMessageDetails(*token, m_protocol.get(), policy); + + // Run the policy over the assertion. Handles replay, freshness, and + // signature verification, assuming the relevant rules are configured. + policy.evaluate(*token); + + // If no security is in place now, we kick it. + if (!policy.isAuthenticated()) + throw SecurityPolicyException("Unable to establish security of incoming assertion."); + + time_t now = time(NULL); + + const PropertySet* sessionProps = application.getPropertySet("Sessions"); + const EntityDescriptor* entity = policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : NULL; + + saml1::NameIdentifier* saml1name=NULL; + saml2::NameID* saml2name=NULL; + const XMLCh* authMethod=NULL; + const XMLCh* authInstant=NULL; + time_t sessionExp = 0; + + const saml1::Assertion* saml1token = dynamic_cast(token); + if (saml1token) { + // Now do profile and core semantic validation to ensure we can use it for SSO. + saml1::AssertionValidator ssoValidator(application.getRelyingParty(entity)->getXMLString("entityID").second, application.getAudiences(), now); + ssoValidator.validateAssertion(*saml1token); + if (!saml1token->getConditions() || !saml1token->getConditions()->getNotBefore() || !saml1token->getConditions()->getNotOnOrAfter()) + throw FatalProfileException("Assertion did not contain time conditions."); + else if (saml1token->getAuthenticationStatements().empty()) + throw FatalProfileException("Assertion did not contain an authentication statement."); + + // authnskew allows rejection of SSO if AuthnInstant is too old. + pair authnskew = sessionProps ? sessionProps->getUnsignedInt("maxTimeSinceAuthn") : pair(false,0); + + const saml1::AuthenticationStatement* ssoStatement=saml1token->getAuthenticationStatements().front(); + if (authnskew.first && authnskew.second && + ssoStatement->getAuthenticationInstant() && (now - ssoStatement->getAuthenticationInstantEpoch() > authnskew.second)) + throw FatalProfileException("The gap between now and the time you logged into your identity provider exceeds the limit."); + + // Address checking. + saml1::SubjectLocality* locality = ssoStatement->getSubjectLocality(); + if (locality && locality->getIPAddress()) { + auto_ptr_char ip(locality->getIPAddress()); + checkAddress(application, httpRequest, ip.get()); + } + + saml1name = ssoStatement->getSubject()->getNameIdentifier(); + authMethod = ssoStatement->getAuthenticationMethod(); + if (ssoStatement->getAuthenticationInstant()) + authInstant = ssoStatement->getAuthenticationInstant()->getRawData(); + + // Session expiration. + pair lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair(true,28800); + if (!lifetime.first || lifetime.second == 0) + lifetime.second = 28800; + sessionExp = now + lifetime.second; + } + else { + const saml2::Assertion* saml2token = dynamic_cast(token); + if (!saml2token) + throw FatalProfileException("Incoming message did not contain a recognized type of SAML assertion."); + + // Now do profile and core semantic validation to ensure we can use it for SSO. + saml2::AssertionValidator ssoValidator(application.getRelyingParty(entity)->getXMLString("entityID").second, application.getAudiences(), now); + ssoValidator.validateAssertion(*saml2token); + if (!saml2token->getConditions() || !saml2token->getConditions()->getNotBefore() || !saml2token->getConditions()->getNotOnOrAfter()) + throw FatalProfileException("Assertion did not contain time conditions."); + else if (saml2token->getAuthnStatements().empty()) + throw FatalProfileException("Assertion did not contain an authentication statement."); + + // authnskew allows rejection of SSO if AuthnInstant is too old. + pair authnskew = sessionProps ? sessionProps->getUnsignedInt("maxTimeSinceAuthn") : pair(false,0); + + const saml2::AuthnStatement* ssoStatement=saml2token->getAuthnStatements().front(); + if (authnskew.first && authnskew.second && + ssoStatement->getAuthnInstant() && (now - ssoStatement->getAuthnInstantEpoch() > authnskew.second)) + throw FatalProfileException("The gap between now and the time you logged into your identity provider exceeds the limit."); + + // Address checking. + saml2::SubjectLocality* locality = ssoStatement->getSubjectLocality(); + if (locality && locality->getAddress()) { + auto_ptr_char ip(locality->getAddress()); + checkAddress(application, httpRequest, ip.get()); + } + + saml2name = saml2token->getSubject() ? saml2token->getSubject()->getNameID() : NULL; + if (ssoStatement->getAuthnContext() && ssoStatement->getAuthnContext()->getAuthnContextClassRef()) + authMethod = ssoStatement->getAuthnContext()->getAuthnContextClassRef()->getReference(); + if (ssoStatement->getAuthnInstant()) + authInstant = ssoStatement->getAuthnInstant()->getRawData(); + + // Session expiration for SAML 2.0 is jointly IdP- and SP-driven. + sessionExp = ssoStatement->getSessionNotOnOrAfter() ? ssoStatement->getSessionNotOnOrAfterEpoch() : 0; + pair lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair(true,28800); + if (!lifetime.first || lifetime.second == 0) + lifetime.second = 28800; + if (sessionExp == 0) + sessionExp = now + lifetime.second; // IdP says nothing, calulate based on SP. + else + sessionExp = min(sessionExp, now + lifetime.second); // Use the lowest. + } + + m_log.debug("ADFS profile processing completed successfully"); + + // We've successfully "accepted" the SSO token. + // To complete processing, we need to extract and resolve attributes and then create the session. + + // Normalize a SAML 1.x NameIdentifier... + auto_ptr nameid(saml1name ? saml2::NameIDBuilder::buildNameID() : NULL); + if (saml1name) { + nameid->setName(saml1name->getName()); + nameid->setFormat(saml1name->getFormat()); + nameid->setNameQualifier(saml1name->getNameQualifier()); + } + + // The context will handle deleting attributes and new tokens. + vector tokens(1,token); + auto_ptr ctx( + resolveAttributes( + application, + policy.getIssuerMetadata(), + m_protocol.get(), + saml1name, + (saml1name ? nameid.get() : saml2name), + authMethod, + NULL, + &tokens + ) + ); + + if (ctx.get()) { + // Copy over any new tokens, but leave them in the context for cleanup. + tokens.insert(tokens.end(), ctx->getResolvedAssertions().begin(), ctx->getResolvedAssertions().end()); + } + + application.getServiceProvider().getSessionCache()->insert( + application, + httpRequest, + httpResponse, + sessionExp, + entity, + m_protocol.get(), + (saml1name ? nameid.get() : saml2name), + authInstant, + NULL, + authMethod, + NULL, + &tokens, + ctx.get() ? &ctx->getResolvedAttributes() : NULL + ); +} + +#endif + +pair ADFSLogoutInitiator::run(SPRequest& request, bool isHandler) const +{ + // Normally we'd do notifications and session clearage here, but ADFS logout + // is missing the needed request/response features, so we have to rely on + // the IdP half to notify us back about the logout and do the work there. + // Basically we have no way to tell in the Logout receiving handler whether + // we initiated the logout or not. + + Session* session = NULL; + try { + session = request.getSession(false, true, false); // don't cache it and ignore all checks + if (!session) + return make_pair(false,0L); + + // We only handle ADFS sessions. + if (!XMLString::equals(session->getProtocol(), WSFED_NS) || !session->getEntityID()) { + session->unlock(); + return make_pair(false,0L); + } + } + catch (exception& ex) { + m_log.error("error accessing current session: %s", ex.what()); + return make_pair(false,0L); + } + + string entityID(session->getEntityID()); + session->unlock(); + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively. + return doRequest(request.getApplication(), entityID.c_str(), request); + } + else { + // When not out of process, we remote the request. + Locker locker(session, false); + DDF out,in(m_address.c_str()); + DDFJanitor jin(in), jout(out); + in.addmember("application_id").string(request.getApplication().getId()); + in.addmember("entity_id").string(entityID.c_str()); + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } +} + +void ADFSLogoutInitiator::receive(DDF& in, ostream& out) +{ +#ifndef SHIBSP_LITE + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for logout", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for logout, deleted?"); + } + + // Set up a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + // Since we're remoted, the result should either be a throw, which we pass on, + // a false/0 return, which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + doRequest(*app, in["entity_id"].string(), *resp.get()); + + out << ret; +#else + throw ConfigurationException("Cannot perform logout using lite version of shibsp library."); +#endif +} + +pair ADFSLogoutInitiator::doRequest(const Application& application, const char* entityID, HTTPResponse& response) const +{ +#ifndef SHIBSP_LITE + try { + if (!entityID) + throw ConfigurationException("Missing entityID parameter."); + + // With a session in hand, we can create a request message, if we can find a compatible endpoint. + MetadataProvider* m=application.getMetadataProvider(); + Locker locker(m); + MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, m_binding.get()); + pair entity=m->getEntityDescriptor(mc); + if (!entity.first) + throw MetadataException("Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", entityID)); + else if (!entity.second) + throw MetadataException("Unable to locate ADFS IdP role for identity provider ($entityID).", namedparams(1, "entityID", entityID)); + + const EndpointType* ep = EndpointManager( + dynamic_cast(entity.second)->getSingleLogoutServices() + ).getByBinding(m_binding.get()); + if (!ep) { + throw MetadataException( + "Unable to locate ADFS single logout service for identity provider ($entityID).", + namedparams(1, "entityID", entityID) + ); + } + + auto_ptr_char dest(ep->getLocation()); + + string req=string(dest.get()) + (strchr(dest.get(),'?') ? '&' : '?') + "wa=wsignout1.0"; + return make_pair(true,response.sendRedirect(req.c_str())); + } + catch (exception& ex) { + m_log.error("error issuing ADFS logout request: %s", ex.what()); + } + + return make_pair(false,0L); +#else + throw ConfigurationException("Cannot perform logout using lite version of shibsp library."); +#endif +} + +pair ADFSLogout::run(SPRequest& request, bool isHandler) const +{ + // Defer to base class for front-channel loop first. + // This won't initiate the loop, only continue/end it. + pair ret = LogoutHandler::run(request, isHandler); + if (ret.first) + return ret; + + // wa parameter indicates the "action" to perform + bool returning = false; + const char* param = request.getParameter("wa"); + if (param) { + if (!strcmp(param, "wsignin1.0")) + return m_login.run(request, isHandler); + else if (strcmp(param, "wsignout1.0") && strcmp(param, "wsignoutcleanup1.0")) + throw FatalProfileException("Unsupported WS-Federation action paremeter ($1).", params(1, param)); + } + else if (strcmp(request.getMethod(),"GET") || !request.getParameter("notifying")) + throw FatalProfileException("Unsupported request to ADFS protocol endpoint."); + else + returning = true; + + param = request.getParameter("wreply"); + const Application& app = request.getApplication(); + + if (!returning) { + // Pass control to the first front channel notification point, if any. + map parammap; + if (param) + parammap["wreply"] = param; + pair result = notifyFrontChannel(app, request, request, ¶mmap); + if (result.first) + return result; + } + + // Best effort on back channel and to remove the user agent's session. + string session_id = app.getServiceProvider().getSessionCache()->active(app, request); + if (!session_id.empty()) { + vector sessions(1,session_id); + notifyBackChannel(app, request.getRequestURL(), sessions, false); + try { + app.getServiceProvider().getSessionCache()->remove(app, request, &request); + } + catch (exception& ex) { + m_log.error("error removing session (%s): %s", session_id.c_str(), ex.what()); + } + } + + if (param) + return make_pair(true, request.sendRedirect(param)); + return sendLogoutPage(app, request, request, false, "Logout complete."); +} diff --git a/adfs/adfs.rc b/adfs/adfs.rc new file mode 100644 index 0000000..11fc309 --- /dev/null +++ b/adfs/adfs.rc @@ -0,0 +1,117 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth 2.0 ADFSv1 Plugin\0" + VALUE "FileVersion", "2, 0, 0, 0\0" +#ifdef SHIBSP_LITE + VALUE "InternalName", "adfs-lite\0" +#else + VALUE "InternalName", "adfs\0" +#endif + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" +#ifdef SHIBSP_LITE + VALUE "OriginalFilename", "adfs-lite.so\0" +#else + VALUE "OriginalFilename", "adfs.so\0" +#endif + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/adfs/adfs.vcproj b/adfs/adfs.vcproj new file mode 100644 index 0000000..ab677ff --- /dev/null +++ b/adfs/adfs.vcproj @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/adfs/resource.h b/adfs/resource.h new file mode 100644 index 0000000..95f2c63 --- /dev/null +++ b/adfs/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by adfs.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/apache/Makefile.am b/apache/Makefile.am new file mode 100644 index 0000000..805ebed --- /dev/null +++ b/apache/Makefile.am @@ -0,0 +1,47 @@ +AUTOMAKE_OPTIONS = foreign + +if BUILD_AP13 +modshib13dir = $(libdir)/@PACKAGE@ +modshib13_LTLIBRARIES = mod_shib_13.la +mod_shib_13_la_SOURCES = mod_shib_13.cpp +mod_shib_13_la_CXXFLAGS = $(APXS_CFLAGS) -I$(APXS_INCLUDE) +mod_shib_13_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +mod_shib_13_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +install-exec-hook: + for la in $(modshib13_LTLIBRARIES) ; do rm -f $(DESTDIR)$(modshib13dir)/$$la ; done + +endif + +if BUILD_AP20 +modshib20dir = $(libdir)/@PACKAGE@ +modshib20_LTLIBRARIES = mod_shib_20.la +mod_shib_20_la_SOURCES = mod_shib_20.cpp +mod_shib_20_la_CXXFLAGS = $(APXS2_CFLAGS) -I$(APXS2_INCLUDE) +mod_shib_20_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +mod_shib_20_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +install-exec-hook: + for la in $(modshib20_LTLIBRARIES) ; do rm -f $(DESTDIR)$(modshib20dir)/$$la ; done + +endif + +if BUILD_AP22 +modshib22dir = $(libdir)/@PACKAGE@ +modshib22_LTLIBRARIES = mod_shib_22.la +mod_shib_22_la_SOURCES = mod_shib_22.cpp +mod_shib_22_la_CXXFLAGS = $(APXS22_CFLAGS) -I$(APXS22_INCLUDE) +mod_shib_22_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +mod_shib_22_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +install-exec-hook: + for la in $(modshib22_LTLIBRARIES) ; do rm -f $(DESTDIR)$(modshib22dir)/$$la ; done + +endif + +EXTRA_DIST = mod_apache.cpp mod_shib_13.cpp mod_shib_20.cpp mod_shib_22.cpp \ + mod_shib13.vcproj mod_shib20.vcproj mod_shib22.vcproj \ + resource.h mod_shib_13.rc mod_shib_20.rc mod_shib_22.rc diff --git a/apache/Makefile.in b/apache/Makefile.in new file mode 100644 index 0000000..ca5a2ed --- /dev/null +++ b/apache/Makefile.in @@ -0,0 +1,698 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = apache +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(modshib13dir)" \ + "$(DESTDIR)$(modshib20dir)" "$(DESTDIR)$(modshib22dir)" +modshib13LTLIBRARIES_INSTALL = $(INSTALL) +modshib20LTLIBRARIES_INSTALL = $(INSTALL) +modshib22LTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(modshib13_LTLIBRARIES) $(modshib20_LTLIBRARIES) \ + $(modshib22_LTLIBRARIES) +@BUILD_AP13_TRUE@mod_shib_13_la_DEPENDENCIES = \ +@BUILD_AP13_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la +am__mod_shib_13_la_SOURCES_DIST = mod_shib_13.cpp +@BUILD_AP13_TRUE@am_mod_shib_13_la_OBJECTS = \ +@BUILD_AP13_TRUE@ mod_shib_13_la-mod_shib_13.lo +mod_shib_13_la_OBJECTS = $(am_mod_shib_13_la_OBJECTS) +@BUILD_AP13_TRUE@am_mod_shib_13_la_rpath = -rpath $(modshib13dir) +@BUILD_AP20_TRUE@mod_shib_20_la_DEPENDENCIES = \ +@BUILD_AP20_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la +am__mod_shib_20_la_SOURCES_DIST = mod_shib_20.cpp +@BUILD_AP20_TRUE@am_mod_shib_20_la_OBJECTS = \ +@BUILD_AP20_TRUE@ mod_shib_20_la-mod_shib_20.lo +mod_shib_20_la_OBJECTS = $(am_mod_shib_20_la_OBJECTS) +@BUILD_AP20_TRUE@am_mod_shib_20_la_rpath = -rpath $(modshib20dir) +@BUILD_AP22_TRUE@mod_shib_22_la_DEPENDENCIES = \ +@BUILD_AP22_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la +am__mod_shib_22_la_SOURCES_DIST = mod_shib_22.cpp +@BUILD_AP22_TRUE@am_mod_shib_22_la_OBJECTS = \ +@BUILD_AP22_TRUE@ mod_shib_22_la-mod_shib_22.lo +mod_shib_22_la_OBJECTS = $(am_mod_shib_22_la_OBJECTS) +@BUILD_AP22_TRUE@am_mod_shib_22_la_rpath = -rpath $(modshib22dir) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(mod_shib_13_la_SOURCES) $(mod_shib_20_la_SOURCES) \ + $(mod_shib_22_la_SOURCES) +DIST_SOURCES = $(am__mod_shib_13_la_SOURCES_DIST) \ + $(am__mod_shib_20_la_SOURCES_DIST) \ + $(am__mod_shib_22_la_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +@BUILD_AP13_TRUE@modshib13dir = $(libdir)/@PACKAGE@ +@BUILD_AP13_TRUE@modshib13_LTLIBRARIES = mod_shib_13.la +@BUILD_AP13_TRUE@mod_shib_13_la_SOURCES = mod_shib_13.cpp +@BUILD_AP13_TRUE@mod_shib_13_la_CXXFLAGS = $(APXS_CFLAGS) -I$(APXS_INCLUDE) +@BUILD_AP13_TRUE@mod_shib_13_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +@BUILD_AP13_TRUE@mod_shib_13_la_LIBADD = \ +@BUILD_AP13_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la + +@BUILD_AP20_TRUE@modshib20dir = $(libdir)/@PACKAGE@ +@BUILD_AP20_TRUE@modshib20_LTLIBRARIES = mod_shib_20.la +@BUILD_AP20_TRUE@mod_shib_20_la_SOURCES = mod_shib_20.cpp +@BUILD_AP20_TRUE@mod_shib_20_la_CXXFLAGS = $(APXS2_CFLAGS) -I$(APXS2_INCLUDE) +@BUILD_AP20_TRUE@mod_shib_20_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +@BUILD_AP20_TRUE@mod_shib_20_la_LIBADD = \ +@BUILD_AP20_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la + +@BUILD_AP22_TRUE@modshib22dir = $(libdir)/@PACKAGE@ +@BUILD_AP22_TRUE@modshib22_LTLIBRARIES = mod_shib_22.la +@BUILD_AP22_TRUE@mod_shib_22_la_SOURCES = mod_shib_22.cpp +@BUILD_AP22_TRUE@mod_shib_22_la_CXXFLAGS = $(APXS22_CFLAGS) -I$(APXS22_INCLUDE) +@BUILD_AP22_TRUE@mod_shib_22_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +@BUILD_AP22_TRUE@mod_shib_22_la_LIBADD = \ +@BUILD_AP22_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la + +EXTRA_DIST = mod_apache.cpp mod_shib_13.cpp mod_shib_20.cpp mod_shib_22.cpp \ + mod_shib13.vcproj mod_shib20.vcproj mod_shib22.vcproj \ + resource.h mod_shib_13.rc mod_shib_20.rc mod_shib_22.rc + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign apache/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign apache/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-modshib13LTLIBRARIES: $(modshib13_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(modshib13dir)" || $(mkdir_p) "$(DESTDIR)$(modshib13dir)" + @list='$(modshib13_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(modshib13LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(modshib13dir)/$$f'"; \ + $(LIBTOOL) --mode=install $(modshib13LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(modshib13dir)/$$f"; \ + else :; fi; \ + done + +uninstall-modshib13LTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(modshib13_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(modshib13dir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(modshib13dir)/$$p"; \ + done + +clean-modshib13LTLIBRARIES: + -test -z "$(modshib13_LTLIBRARIES)" || rm -f $(modshib13_LTLIBRARIES) + @list='$(modshib13_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-modshib20LTLIBRARIES: $(modshib20_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(modshib20dir)" || $(mkdir_p) "$(DESTDIR)$(modshib20dir)" + @list='$(modshib20_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(modshib20LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(modshib20dir)/$$f'"; \ + $(LIBTOOL) --mode=install $(modshib20LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(modshib20dir)/$$f"; \ + else :; fi; \ + done + +uninstall-modshib20LTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(modshib20_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(modshib20dir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(modshib20dir)/$$p"; \ + done + +clean-modshib20LTLIBRARIES: + -test -z "$(modshib20_LTLIBRARIES)" || rm -f $(modshib20_LTLIBRARIES) + @list='$(modshib20_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-modshib22LTLIBRARIES: $(modshib22_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(modshib22dir)" || $(mkdir_p) "$(DESTDIR)$(modshib22dir)" + @list='$(modshib22_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(modshib22LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(modshib22dir)/$$f'"; \ + $(LIBTOOL) --mode=install $(modshib22LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(modshib22dir)/$$f"; \ + else :; fi; \ + done + +uninstall-modshib22LTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(modshib22_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(modshib22dir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(modshib22dir)/$$p"; \ + done + +clean-modshib22LTLIBRARIES: + -test -z "$(modshib22_LTLIBRARIES)" || rm -f $(modshib22_LTLIBRARIES) + @list='$(modshib22_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +mod_shib_13.la: $(mod_shib_13_la_OBJECTS) $(mod_shib_13_la_DEPENDENCIES) + $(CXXLINK) $(am_mod_shib_13_la_rpath) $(mod_shib_13_la_LDFLAGS) $(mod_shib_13_la_OBJECTS) $(mod_shib_13_la_LIBADD) $(LIBS) +mod_shib_20.la: $(mod_shib_20_la_OBJECTS) $(mod_shib_20_la_DEPENDENCIES) + $(CXXLINK) $(am_mod_shib_20_la_rpath) $(mod_shib_20_la_LDFLAGS) $(mod_shib_20_la_OBJECTS) $(mod_shib_20_la_LIBADD) $(LIBS) +mod_shib_22.la: $(mod_shib_22_la_OBJECTS) $(mod_shib_22_la_DEPENDENCIES) + $(CXXLINK) $(am_mod_shib_22_la_rpath) $(mod_shib_22_la_LDFLAGS) $(mod_shib_22_la_OBJECTS) $(mod_shib_22_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_shib_13_la-mod_shib_13.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_shib_20_la-mod_shib_20.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_shib_22_la-mod_shib_22.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mod_shib_13_la-mod_shib_13.lo: mod_shib_13.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_shib_13_la_CXXFLAGS) $(CXXFLAGS) -MT mod_shib_13_la-mod_shib_13.lo -MD -MP -MF "$(DEPDIR)/mod_shib_13_la-mod_shib_13.Tpo" -c -o mod_shib_13_la-mod_shib_13.lo `test -f 'mod_shib_13.cpp' || echo '$(srcdir)/'`mod_shib_13.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mod_shib_13_la-mod_shib_13.Tpo" "$(DEPDIR)/mod_shib_13_la-mod_shib_13.Plo"; else rm -f "$(DEPDIR)/mod_shib_13_la-mod_shib_13.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mod_shib_13.cpp' object='mod_shib_13_la-mod_shib_13.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_shib_13_la_CXXFLAGS) $(CXXFLAGS) -c -o mod_shib_13_la-mod_shib_13.lo `test -f 'mod_shib_13.cpp' || echo '$(srcdir)/'`mod_shib_13.cpp + +mod_shib_20_la-mod_shib_20.lo: mod_shib_20.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_shib_20_la_CXXFLAGS) $(CXXFLAGS) -MT mod_shib_20_la-mod_shib_20.lo -MD -MP -MF "$(DEPDIR)/mod_shib_20_la-mod_shib_20.Tpo" -c -o mod_shib_20_la-mod_shib_20.lo `test -f 'mod_shib_20.cpp' || echo '$(srcdir)/'`mod_shib_20.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mod_shib_20_la-mod_shib_20.Tpo" "$(DEPDIR)/mod_shib_20_la-mod_shib_20.Plo"; else rm -f "$(DEPDIR)/mod_shib_20_la-mod_shib_20.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mod_shib_20.cpp' object='mod_shib_20_la-mod_shib_20.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_shib_20_la_CXXFLAGS) $(CXXFLAGS) -c -o mod_shib_20_la-mod_shib_20.lo `test -f 'mod_shib_20.cpp' || echo '$(srcdir)/'`mod_shib_20.cpp + +mod_shib_22_la-mod_shib_22.lo: mod_shib_22.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_shib_22_la_CXXFLAGS) $(CXXFLAGS) -MT mod_shib_22_la-mod_shib_22.lo -MD -MP -MF "$(DEPDIR)/mod_shib_22_la-mod_shib_22.Tpo" -c -o mod_shib_22_la-mod_shib_22.lo `test -f 'mod_shib_22.cpp' || echo '$(srcdir)/'`mod_shib_22.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mod_shib_22_la-mod_shib_22.Tpo" "$(DEPDIR)/mod_shib_22_la-mod_shib_22.Plo"; else rm -f "$(DEPDIR)/mod_shib_22_la-mod_shib_22.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mod_shib_22.cpp' object='mod_shib_22_la-mod_shib_22.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_shib_22_la_CXXFLAGS) $(CXXFLAGS) -c -o mod_shib_22_la-mod_shib_22.lo `test -f 'mod_shib_22.cpp' || echo '$(srcdir)/'`mod_shib_22.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(modshib13dir)" "$(DESTDIR)$(modshib20dir)" "$(DESTDIR)$(modshib22dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@BUILD_AP13_FALSE@@BUILD_AP20_FALSE@@BUILD_AP22_FALSE@install-exec-hook: +clean: clean-am + +clean-am: clean-generic clean-libtool clean-modshib13LTLIBRARIES \ + clean-modshib20LTLIBRARIES clean-modshib22LTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-modshib13LTLIBRARIES \ + install-modshib20LTLIBRARIES install-modshib22LTLIBRARIES + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-modshib13LTLIBRARIES \ + uninstall-modshib20LTLIBRARIES uninstall-modshib22LTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-modshib13LTLIBRARIES \ + clean-modshib20LTLIBRARIES clean-modshib22LTLIBRARIES ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-exec-hook \ + install-info install-info-am install-man \ + install-modshib13LTLIBRARIES install-modshib20LTLIBRARIES \ + install-modshib22LTLIBRARIES install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-modshib13LTLIBRARIES uninstall-modshib20LTLIBRARIES \ + uninstall-modshib22LTLIBRARIES + + +@BUILD_AP13_TRUE@install-exec-hook: +@BUILD_AP13_TRUE@ for la in $(modshib13_LTLIBRARIES) ; do rm -f $(DESTDIR)$(modshib13dir)/$$la ; done + +@BUILD_AP20_TRUE@install-exec-hook: +@BUILD_AP20_TRUE@ for la in $(modshib20_LTLIBRARIES) ; do rm -f $(DESTDIR)$(modshib20dir)/$$la ; done + +@BUILD_AP22_TRUE@install-exec-hook: +@BUILD_AP22_TRUE@ for la in $(modshib22_LTLIBRARIES) ; do rm -f $(DESTDIR)$(modshib22dir)/$$la ; done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apache/mod_apache.cpp b/apache/mod_apache.cpp new file mode 100644 index 0000000..cbc0dbf --- /dev/null +++ b/apache/mod_apache.cpp @@ -0,0 +1,1555 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * mod_apache.cpp + * + * Apache module implementation + */ + +#define SHIBSP_LITE + +#ifdef SOLARIS2 +#undef _XOPEN_SOURCE // causes gethostname conflict in unistd.h +#endif + +#ifdef WIN32 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +# include +#endif + +#undef _XPG4_2 + +// Apache specific header files +#include +#include +#include +#include +#define CORE_PRIVATE +#include +#include +#include + +#ifndef SHIB_APACHE_13 +#include +#include +#include +#endif + +#include +#include + +#ifdef HAVE_UNISTD_H +#include // for getpid() +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; +using xercesc::RegularExpression; +using xercesc::XMLException; + +extern "C" module MODULE_VAR_EXPORT mod_shib; + +namespace { + char* g_szSHIBConfig = NULL; + char* g_szSchemaDir = NULL; + char* g_szPrefix = NULL; + SPConfig* g_Config = NULL; + string g_unsetHeaderValue; + bool g_checkSpoofing = true; + bool g_catchAll = false; + static const char* g_UserDataKey = "_shib_check_user_"; + static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); + static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); +} + +/* Apache 2.2.x headers must be accumulated and set in the output filter. + Apache 2.0.49+ supports the filter method. + Apache 1.3.x and lesser 2.0.x must write the headers directly. */ + +#if (defined(SHIB_APACHE_20) || defined(SHIB_APACHE_22)) && AP_MODULE_MAGIC_AT_LEAST(20020903,6) +#define SHIB_DEFERRED_HEADERS +#endif + +/********************************************************************************/ +// Basic Apache Configuration code. +// + +// per-server module configuration structure +struct shib_server_config +{ + char* szScheme; +}; + +// creates the per-server configuration +extern "C" void* create_shib_server_config(SH_AP_POOL* p, server_rec* s) +{ + shib_server_config* sc=(shib_server_config*)ap_pcalloc(p,sizeof(shib_server_config)); + sc->szScheme = NULL; + return sc; +} + +// overrides server configuration in virtual servers +extern "C" void* merge_shib_server_config (SH_AP_POOL* p, void* base, void* sub) +{ + shib_server_config* sc=(shib_server_config*)ap_pcalloc(p,sizeof(shib_server_config)); + shib_server_config* parent=(shib_server_config*)base; + shib_server_config* child=(shib_server_config*)sub; + + if (child->szScheme) + sc->szScheme=ap_pstrdup(p,child->szScheme); + else if (parent->szScheme) + sc->szScheme=ap_pstrdup(p,parent->szScheme); + else + sc->szScheme=NULL; + + return sc; +} + +// per-dir module configuration structure +struct shib_dir_config +{ + SH_AP_TABLE* tSettings; // generic table of extensible settings + + // RM Configuration + char* szAuthGrpFile; // Auth GroupFile name + int bRequireAll; // all "known" require directives must match, otherwise OR logic + int bAuthoritative; // allow htaccess plugin to DECLINE when authz fails + + // Content Configuration + char* szApplicationId; // Shib applicationId value + char* szRequireWith; // require a session using a specific initiator? + char* szRedirectToSSL; // redirect non-SSL requests to SSL port + int bOff; // flat-out disable all Shib processing + int bBasicHijack; // activate for AuthType Basic? + int bRequireSession; // require a session? + int bExportAssertion; // export SAML assertion to the environment? + int bUseEnvVars; // use environment? + int bUseHeaders; // use headers? +}; + +// creates per-directory config structure +extern "C" void* create_shib_dir_config (SH_AP_POOL* p, char* d) +{ + shib_dir_config* dc=(shib_dir_config*)ap_pcalloc(p,sizeof(shib_dir_config)); + dc->tSettings = NULL; + dc->szAuthGrpFile = NULL; + dc->bRequireAll = -1; + dc->bAuthoritative = -1; + dc->szApplicationId = NULL; + dc->szRequireWith = NULL; + dc->szRedirectToSSL = NULL; + dc->bOff = -1; + dc->bBasicHijack = -1; + dc->bRequireSession = -1; + dc->bExportAssertion = -1; + dc->bUseEnvVars = -1; + dc->bUseHeaders = -1; + return dc; +} + +// overrides server configuration in directories +extern "C" void* merge_shib_dir_config (SH_AP_POOL* p, void* base, void* sub) +{ + shib_dir_config* dc=(shib_dir_config*)ap_pcalloc(p,sizeof(shib_dir_config)); + shib_dir_config* parent=(shib_dir_config*)base; + shib_dir_config* child=(shib_dir_config*)sub; + + // The child supersedes any matching table settings in the parent. + dc->tSettings = NULL; + if (parent->tSettings) + dc->tSettings = ap_copy_table(p, parent->tSettings); + if (child->tSettings) { + if (dc->tSettings) + ap_overlap_tables(dc->tSettings, child->tSettings, AP_OVERLAP_TABLES_SET); + else + dc->tSettings = ap_copy_table(p, child->tSettings); + } + + if (child->szAuthGrpFile) + dc->szAuthGrpFile=ap_pstrdup(p,child->szAuthGrpFile); + else if (parent->szAuthGrpFile) + dc->szAuthGrpFile=ap_pstrdup(p,parent->szAuthGrpFile); + else + dc->szAuthGrpFile=NULL; + + if (child->szApplicationId) + dc->szApplicationId=ap_pstrdup(p,child->szApplicationId); + else if (parent->szApplicationId) + dc->szApplicationId=ap_pstrdup(p,parent->szApplicationId); + else + dc->szApplicationId=NULL; + + if (child->szRequireWith) + dc->szRequireWith=ap_pstrdup(p,child->szRequireWith); + else if (parent->szRequireWith) + dc->szRequireWith=ap_pstrdup(p,parent->szRequireWith); + else + dc->szRequireWith=NULL; + + if (child->szRedirectToSSL) + dc->szRedirectToSSL=ap_pstrdup(p,child->szRedirectToSSL); + else if (parent->szRedirectToSSL) + dc->szRedirectToSSL=ap_pstrdup(p,parent->szRedirectToSSL); + else + dc->szRedirectToSSL=NULL; + + dc->bOff=((child->bOff==-1) ? parent->bOff : child->bOff); + dc->bBasicHijack=((child->bBasicHijack==-1) ? parent->bBasicHijack : child->bBasicHijack); + dc->bRequireSession=((child->bRequireSession==-1) ? parent->bRequireSession : child->bRequireSession); + dc->bExportAssertion=((child->bExportAssertion==-1) ? parent->bExportAssertion : child->bExportAssertion); + dc->bRequireAll=((child->bRequireAll==-1) ? parent->bRequireAll : child->bRequireAll); + dc->bAuthoritative=((child->bAuthoritative==-1) ? parent->bAuthoritative : child->bAuthoritative); + dc->bUseEnvVars=((child->bUseEnvVars==-1) ? parent->bUseEnvVars : child->bUseEnvVars); + dc->bUseHeaders=((child->bUseHeaders==-1) ? parent->bUseHeaders : child->bUseHeaders); + return dc; +} + +// per-request module structure +struct shib_request_config +{ + SH_AP_TABLE *env; // environment vars +#ifdef SHIB_DEFERRED_HEADERS + SH_AP_TABLE *hdr_out; // headers to browser +#endif +}; + +// create a request record +static shib_request_config *init_request_config(request_rec *r) +{ + shib_request_config* rc=(shib_request_config*)ap_pcalloc(r->pool,sizeof(shib_request_config)); + ap_set_module_config (r->request_config, &mod_shib, rc); + memset(rc, 0, sizeof(shib_request_config)); + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r), "shib_init_rc"); + return rc; +} + +// generic global slot handlers +extern "C" const char* ap_set_global_string_slot(cmd_parms* parms, void*, const char* arg) +{ + *((char**)(parms->info))=ap_pstrdup(parms->pool,arg); + return NULL; +} + +extern "C" const char* shib_set_server_string_slot(cmd_parms* parms, void*, const char* arg) +{ + char* base=(char*)ap_get_module_config(parms->server->module_config,&mod_shib); + size_t offset=(size_t)parms->info; + *((char**)(base + offset))=ap_pstrdup(parms->pool,arg); + return NULL; +} + +extern "C" const char* shib_ap_set_file_slot(cmd_parms* parms, +#ifdef SHIB_APACHE_13 + char* arg1, char* arg2 +#else + void* arg1, const char* arg2 +#endif + ) +{ + ap_set_file_slot(parms, arg1, arg2); + return DECLINE_CMD; +} + +extern "C" const char* shib_table_set(cmd_parms* parms, shib_dir_config* dc, const char* arg1, const char* arg2) +{ + if (!dc->tSettings) + dc->tSettings = ap_make_table(parms->pool, 4); + ap_table_set(dc->tSettings, arg1, arg2); + return NULL; +} + +/********************************************************************************/ +// Apache ShibTarget subclass(es) here. + +class ShibTargetApache : public AbstractSPRequest +{ + bool m_handler; + mutable string m_body; + mutable bool m_gotBody; + mutable vector m_certs; + set m_allhttp; + +public: + request_rec* m_req; + shib_dir_config* m_dc; + shib_server_config* m_sc; + shib_request_config* m_rc; + + ShibTargetApache(request_rec* req, bool handler) : AbstractSPRequest(SHIBSP_LOGCAT".Apache"), m_handler(handler), m_gotBody(false) { + m_sc = (shib_server_config*)ap_get_module_config(req->server->module_config, &mod_shib); + m_dc = (shib_dir_config*)ap_get_module_config(req->per_dir_config, &mod_shib); + m_rc = (shib_request_config*)ap_get_module_config(req->request_config, &mod_shib); + m_req = req; + + setRequestURI(m_req->unparsed_uri); + } + virtual ~ShibTargetApache() {} + + const char* getScheme() const { + return m_sc->szScheme ? m_sc->szScheme : ap_http_method(m_req); + } + const char* getHostname() const { + return ap_get_server_name(m_req); + } + int getPort() const { + return ap_get_server_port(m_req); + } + const char* getMethod() const { + return m_req->method; + } + string getContentType() const { + const char* type = ap_table_get(m_req->headers_in, "Content-Type"); + return type ? type : ""; + } + long getContentLength() const { + return m_gotBody ? m_body.length() : m_req->remaining; + } + string getRemoteAddr() const { + return m_req->connection->remote_ip; + } + void log(SPLogLevel level, const string& msg) const { + AbstractSPRequest::log(level,msg); + ap_log_rerror( + APLOG_MARK, + (level == SPDebug ? APLOG_DEBUG : + (level == SPInfo ? APLOG_INFO : + (level == SPWarn ? APLOG_WARNING : + (level == SPError ? APLOG_ERR : APLOG_CRIT))))|APLOG_NOERRNO, + SH_AP_R(m_req), + msg.c_str() + ); + } + const char* getQueryString() const { return m_req->args; } + const char* getRequestBody() const { + if (m_gotBody || m_req->method_number==M_GET) + return m_body.c_str(); +#ifdef SHIB_APACHE_13 + // Read the posted data + if (ap_setup_client_block(m_req, REQUEST_CHUNKED_DECHUNK) != OK) { + m_gotBody=true; + log(SPError, "Apache function (setup_client_block) failed while reading request body."); + return m_body.c_str(); + } + if (!ap_should_client_block(m_req)) { + m_gotBody=true; + log(SPError, "Apache function (should_client_block) failed while reading request body."); + return m_body.c_str(); + } + if (m_req->remaining > 1024*1024) + throw opensaml::SecurityPolicyException("Blocked request body larger than 1M size limit."); + m_gotBody=true; + int len; + char buff[HUGE_STRING_LEN]; + ap_hard_timeout("[mod_shib] getRequestBody", m_req); + while ((len=ap_get_client_block(m_req, buff, sizeof(buff))) > 0) { + ap_reset_timeout(m_req); + m_body.append(buff, len); + } + ap_kill_timeout(m_req); +#else + const char *data; + apr_size_t len; + int seen_eos = 0; + apr_bucket_brigade* bb = apr_brigade_create(m_req->pool, m_req->connection->bucket_alloc); + do { + apr_bucket *bucket; + apr_status_t rv = ap_get_brigade(m_req->input_filters, bb, AP_MODE_READBYTES, APR_BLOCK_READ, HUGE_STRING_LEN); + if (rv != APR_SUCCESS) { + log(SPError, "Apache function (ap_get_brigade) failed while reading request body."); + break; + } + + for (bucket = APR_BRIGADE_FIRST(bb); bucket != APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) { + if (APR_BUCKET_IS_EOS(bucket)) { + seen_eos = 1; + break; + } + + /* We can't do much with this. */ + if (APR_BUCKET_IS_FLUSH(bucket)) + continue; + + /* read */ + apr_bucket_read(bucket, &data, &len, APR_BLOCK_READ); + if (len > 0) + m_body.append(data, len); + } + apr_brigade_cleanup(bb); + } while (!seen_eos); + apr_brigade_destroy(bb); + m_gotBody=true; +#endif + return m_body.c_str(); + } + void clearHeader(const char* rawname, const char* cginame) { + if (m_dc->bUseHeaders == 1) { + // ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(m_req), "shib_clear_header: hdr\n"); + if (g_checkSpoofing && ap_is_initial_req(m_req)) { + if (m_allhttp.empty()) { + // First time, so populate set with "CGI" versions of client-supplied headers. +#ifdef SHIB_APACHE_13 + array_header *hdrs_arr = ap_table_elts(m_req->headers_in); + table_entry *hdrs = (table_entry *) hdrs_arr->elts; +#else + const apr_array_header_t *hdrs_arr = apr_table_elts(m_req->headers_in); + const apr_table_entry_t *hdrs = (const apr_table_entry_t *) hdrs_arr->elts; +#endif + for (int i = 0; i < hdrs_arr->nelts; ++i) { + if (!hdrs[i].key) + continue; + string cgiversion("HTTP_"); + const char* pch = hdrs[i].key; + while (*pch) { + cgiversion += (isalnum(*pch) ? toupper(*pch) : '_'); + pch++; + } + m_allhttp.insert(cgiversion); + } + } + + if (m_allhttp.count(cginame) > 0) + throw opensaml::SecurityPolicyException("Attempt to spoof header ($1) was detected.", params(1, rawname)); + } + ap_table_unset(m_req->headers_in, rawname); + ap_table_set(m_req->headers_in, rawname, g_unsetHeaderValue.c_str()); + } + } + void setHeader(const char* name, const char* value) { + if (m_dc->bUseEnvVars != 0) { + if (!m_rc) { + // this happens on subrequests + // ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(m_req), "shib_setheader: no_m_rc\n"); + m_rc = init_request_config(m_req); + } + if (!m_rc->env) + m_rc->env = ap_make_table(m_req->pool, 10); + // ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(m_req), "shib_set_env: %s=%s\n", name, value?value:"Null"); + ap_table_set(m_rc->env, name, value ? value : ""); + } + if (m_dc->bUseHeaders == 1) + ap_table_set(m_req->headers_in, name, value); + } + string getHeader(const char* name) const { + const char* hdr = ap_table_get(m_req->headers_in, name); + return string(hdr ? hdr : ""); + } + string getSecureHeader(const char* name) const { + if (m_dc->bUseEnvVars != 0) { + const char *hdr; + if (m_rc && m_rc->env) + hdr = ap_table_get(m_rc->env, name); + else + hdr = NULL; + return string(hdr ? hdr : ""); + } + return getHeader(name); + } + void setRemoteUser(const char* user) { + SH_AP_USER(m_req) = user ? ap_pstrdup(m_req->pool, user) : NULL; + } + string getRemoteUser() const { + return string(SH_AP_USER(m_req) ? SH_AP_USER(m_req) : ""); + } + void setContentType(const char* type) { + m_req->content_type = ap_psprintf(m_req->pool, type); + } + void setResponseHeader(const char* name, const char* value) { +#ifdef SHIB_DEFERRED_HEADERS + if (!m_rc) + // this happens on subrequests + m_rc = init_request_config(m_req); + if (m_handler) + ap_table_add(m_rc->hdr_out, name, value); + else +#endif + ap_table_add(m_req->err_headers_out, name, value); + } + long sendResponse(istream& in, long status) { + if (status != XMLTOOLING_HTTP_STATUS_OK) + m_req->status = status; + ap_send_http_header(m_req); + char buf[1024]; + while (in) { + in.read(buf,1024); + ap_rwrite(buf,in.gcount(),m_req); + } +#if (defined(SHIB_APACHE_20) || defined(SHIB_APACHE_22)) + if (status != XMLTOOLING_HTTP_STATUS_OK && status != XMLTOOLING_HTTP_STATUS_ERROR) + return status; +#endif + return DONE; + } + long sendRedirect(const char* url) { + ap_table_set(m_req->headers_out, "Location", url); + return REDIRECT; + } + const vector& getClientCertificates() const { + if (m_certs.empty()) { + const char* cert = ap_table_get(m_req->subprocess_env, "SSL_CLIENT_CERT"); + if (cert) + m_certs.push_back(cert); + int i = 0; + do { + cert = ap_table_get(m_req->subprocess_env, ap_psprintf(m_req->pool, "SSL_CLIENT_CERT_CHAIN_%d", i++)); + if (cert) + m_certs.push_back(cert); + } while (cert); + } + return m_certs; + } + long returnDecline(void) { return DECLINED; } + long returnOK(void) { return OK; } +}; + +/********************************************************************************/ +// Apache handlers + +extern "C" int shib_check_user(request_rec* r) +{ + // Short-circuit entirely? + if (((shib_dir_config*)ap_get_module_config(r->per_dir_config, &mod_shib))->bOff==1) + return DECLINED; + + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r), "shib_check_user(%d): ENTER", (int)getpid()); + + ostringstream threadid; + threadid << "[" << getpid() << "] shib_check_user" << '\0'; + xmltooling::NDC ndc(threadid.str().c_str()); + + try { + ShibTargetApache sta(r,false); + + // Check user authentication and export information, then set the handler bypass + pair res = sta.getServiceProvider().doAuthentication(sta,true); + apr_pool_userdata_setn((const void*)42,g_UserDataKey,NULL,r->pool); + if (res.first) return res.second; + + // user auth was okay -- export the assertions now + res = sta.getServiceProvider().doExport(sta); + if (res.first) return res.second; + + // export happened successfully.. this user is ok. + return OK; + } + catch (exception& e) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an exception: %s", e.what()); + return SERVER_ERROR; + } + catch (...) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an unknown exception!"); + if (g_catchAll) + return SERVER_ERROR; + throw; + } +} + +extern "C" int shib_handler(request_rec* r) +{ + // Short-circuit entirely? + if (((shib_dir_config*)ap_get_module_config(r->per_dir_config, &mod_shib))->bOff==1) + return DECLINED; + + ostringstream threadid; + threadid << "[" << getpid() << "] shib_handler" << '\0'; + xmltooling::NDC ndc(threadid.str().c_str()); + +#ifndef SHIB_APACHE_13 + // With 2.x, this handler always runs, though last. + // We check if shib_check_user ran, because it will detect a handler request + // and dispatch it directly. + void* data; + apr_pool_userdata_get(&data,g_UserDataKey,r->pool); + if (data==(const void*)42) { + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r),"shib_handler skipped since check_user ran"); + return DECLINED; + } +#endif + + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r),"shib_handler(%d): ENTER: %s", (int)getpid(), r->handler); + + try { + ShibTargetApache sta(r,true); + + pair res = sta.getServiceProvider().doHandler(sta); + if (res.first) return res.second; + + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "doHandler() did not do anything."); + return SERVER_ERROR; + } + catch (exception& e) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an exception: %s", e.what()); + return SERVER_ERROR; + } + catch (...) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an unknown exception!"); + if (g_catchAll) + return SERVER_ERROR; + throw; + } +} + +/* + * shib_auth_checker() -- a simple resource manager to + * process the .htaccess settings + */ +extern "C" int shib_auth_checker(request_rec* r) +{ + // Short-circuit entirely? + if (((shib_dir_config*)ap_get_module_config(r->per_dir_config, &mod_shib))->bOff==1) + return DECLINED; + + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r), "shib_auth_checker(%d): ENTER", (int)getpid()); + + ostringstream threadid; + threadid << "[" << getpid() << "] shib_auth_checker" << '\0'; + xmltooling::NDC ndc(threadid.str().c_str()); + + try { + ShibTargetApache sta(r,false); + + pair res = sta.getServiceProvider().doAuthorization(sta); + if (res.first) return res.second; + + // The SP method should always return true, so if we get this far, something unusual happened. + // Just let Apache (or some other module) decide what to do. + return DECLINED; + } + catch (exception& e) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an exception: %s", e.what()); + return SERVER_ERROR; + } + catch (...) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an unknown exception!"); + if (g_catchAll) + return SERVER_ERROR; + throw; + } +} + +// Access control plugin that enforces htaccess rules +class htAccessControl : virtual public AccessControl +{ +public: + htAccessControl() {} + ~htAccessControl() {} + Lockable* lock() {return this;} + void unlock() {} + aclresult_t authorized(const SPRequest& request, const Session* session) const; +private: + bool checkAttribute(const SPRequest& request, const Attribute* attr, const char* toMatch, RegularExpression* re) const; +}; + +AccessControl* htAccessFactory(const xercesc::DOMElement* const & e) +{ + return new htAccessControl(); +} + +class ApacheRequestMapper : public virtual RequestMapper, public virtual PropertySet +{ +public: + ApacheRequestMapper(const xercesc::DOMElement* e); + ~ApacheRequestMapper() { delete m_mapper; delete m_htaccess; delete m_staKey; delete m_propsKey; } + Lockable* lock() { return m_mapper->lock(); } + void unlock() { m_staKey->setData(NULL); m_propsKey->setData(NULL); m_mapper->unlock(); } + Settings getSettings(const HTTPRequest& request) const; + + const PropertySet* getParent() const { return NULL; } + void setParent(const PropertySet*) {} + pair getBool(const char* name, const char* ns=NULL) const; + pair getString(const char* name, const char* ns=NULL) const; + pair getXMLString(const char* name, const char* ns=NULL) const; + pair getUnsignedInt(const char* name, const char* ns=NULL) const; + pair getInt(const char* name, const char* ns=NULL) const; + void getAll(map& properties) const; + const PropertySet* getPropertySet(const char* name, const char* ns=shibspconstants::ASCII_SHIB2SPCONFIG_NS) const; + const xercesc::DOMElement* getElement() const; + +private: + RequestMapper* m_mapper; + ThreadKey* m_staKey; + ThreadKey* m_propsKey; + AccessControl* m_htaccess; +}; + +RequestMapper* ApacheRequestMapFactory(const xercesc::DOMElement* const & e) +{ + return new ApacheRequestMapper(e); +} + +ApacheRequestMapper::ApacheRequestMapper(const xercesc::DOMElement* e) : m_mapper(NULL), m_staKey(NULL), m_propsKey(NULL), m_htaccess(NULL) +{ + m_mapper=SPConfig::getConfig().RequestMapperManager.newPlugin(XML_REQUEST_MAPPER,e); + m_htaccess=new htAccessControl(); + m_staKey=ThreadKey::create(NULL); + m_propsKey=ThreadKey::create(NULL); +} + +RequestMapper::Settings ApacheRequestMapper::getSettings(const HTTPRequest& request) const +{ + Settings s=m_mapper->getSettings(request); + m_staKey->setData((void*)dynamic_cast(&request)); + m_propsKey->setData((void*)s.first); + return pair(this,s.second ? s.second : m_htaccess); +} + +pair ApacheRequestMapper::getBool(const char* name, const char* ns) const +{ + const ShibTargetApache* sta=reinterpret_cast(m_staKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (sta && !ns) { + // Override Apache-settable boolean properties. + if (name && !strcmp(name,"requireSession") && sta->m_dc->bRequireSession != -1) + return make_pair(true, sta->m_dc->bRequireSession==1); + else if (name && !strcmp(name,"exportAssertion") && sta->m_dc->bExportAssertion != -1) + return make_pair(true, sta->m_dc->bExportAssertion==1); + else if (sta->m_dc->tSettings) { + const char* prop = ap_table_get(sta->m_dc->tSettings, name); + if (prop) + return make_pair(true, !strcmp(prop, "true") || !strcmp(prop, "1") || !strcmp(prop, "On")); + } + } + return s ? s->getBool(name,ns) : make_pair(false,false); +} + +pair ApacheRequestMapper::getString(const char* name, const char* ns) const +{ + const ShibTargetApache* sta=reinterpret_cast(m_staKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (sta && !ns) { + // Override Apache-settable string properties. + if (name && !strcmp(name,"authType")) { + const char *auth_type=ap_auth_type(sta->m_req); + if (auth_type) { + // Check for Basic Hijack + if (!strcasecmp(auth_type, "basic") && sta->m_dc->bBasicHijack == 1) + auth_type = "shibboleth"; + return make_pair(true,auth_type); + } + } + else if (name && !strcmp(name,"applicationId") && sta->m_dc->szApplicationId) + return pair(true,sta->m_dc->szApplicationId); + else if (name && !strcmp(name,"requireSessionWith") && sta->m_dc->szRequireWith) + return pair(true,sta->m_dc->szRequireWith); + else if (name && !strcmp(name,"redirectToSSL") && sta->m_dc->szRedirectToSSL) + return pair(true,sta->m_dc->szRedirectToSSL); + else if (sta->m_dc->tSettings) { + const char* prop = ap_table_get(sta->m_dc->tSettings, name); + if (prop) + return make_pair(true, prop); + } + } + return s ? s->getString(name,ns) : pair(false,NULL); +} + +pair ApacheRequestMapper::getXMLString(const char* name, const char* ns) const +{ + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + return s ? s->getXMLString(name,ns) : pair(false,NULL); +} + +pair ApacheRequestMapper::getUnsignedInt(const char* name, const char* ns) const +{ + const ShibTargetApache* sta=reinterpret_cast(m_staKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (sta && !ns) { + // Override Apache-settable int properties. + if (name && !strcmp(name,"redirectToSSL") && sta->m_dc->szRedirectToSSL) + return pair(true, strtol(sta->m_dc->szRedirectToSSL, NULL, 10)); + else if (sta->m_dc->tSettings) { + const char* prop = ap_table_get(sta->m_dc->tSettings, name); + if (prop) + return pair(true, atoi(prop)); + } + } + return s ? s->getUnsignedInt(name,ns) : pair(false,0); +} + +pair ApacheRequestMapper::getInt(const char* name, const char* ns) const +{ + const ShibTargetApache* sta=reinterpret_cast(m_staKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (sta && !ns) { + // Override Apache-settable int properties. + if (name && !strcmp(name,"redirectToSSL") && sta->m_dc->szRedirectToSSL) + return pair(true,atoi(sta->m_dc->szRedirectToSSL)); + else if (sta->m_dc->tSettings) { + const char* prop = ap_table_get(sta->m_dc->tSettings, name); + if (prop) + return make_pair(true, atoi(prop)); + } + } + return s ? s->getInt(name,ns) : pair(false,0); +} + +void ApacheRequestMapper::getAll(map& properties) const +{ + const ShibTargetApache* sta=reinterpret_cast(m_staKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + + if (s) + s->getAll(properties); + if (!sta) + return; + + const char* auth_type=ap_auth_type(sta->m_req); + if (auth_type) { + // Check for Basic Hijack + if (!strcasecmp(auth_type, "basic") && sta->m_dc->bBasicHijack == 1) + auth_type = "shibboleth"; + properties["authType"] = auth_type; + } + + if (sta->m_dc->szApplicationId) + properties["applicationId"] = sta->m_dc->szApplicationId; + if (sta->m_dc->szRequireWith) + properties["requireSessionWith"] = sta->m_dc->szRequireWith; + if (sta->m_dc->szRedirectToSSL) + properties["redirectToSSL"] = sta->m_dc->szRedirectToSSL; + if (sta->m_dc->bRequireSession != 0) + properties["requireSession"] = (sta->m_dc->bRequireSession==1) ? "true" : "false"; + if (sta->m_dc->bExportAssertion != 0) + properties["exportAssertion"] = (sta->m_dc->bExportAssertion==1) ? "true" : "false"; +} + +const PropertySet* ApacheRequestMapper::getPropertySet(const char* name, const char* ns) const +{ + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + return s ? s->getPropertySet(name,ns) : NULL; +} + +const xercesc::DOMElement* ApacheRequestMapper::getElement() const +{ + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + return s ? s->getElement() : NULL; +} + +static SH_AP_TABLE* groups_for_user(request_rec* r, const char* user, char* grpfile) +{ + SH_AP_CONFIGFILE* f; + SH_AP_TABLE* grps=ap_make_table(r->pool,15); + char l[MAX_STRING_LEN]; + const char *group_name, *ll, *w; + +#ifdef SHIB_APACHE_13 + if (!(f=ap_pcfg_openfile(r->pool,grpfile))) { +#else + if (ap_pcfg_openfile(&f,r->pool,grpfile) != APR_SUCCESS) { +#endif + ap_log_rerror(APLOG_MARK,APLOG_DEBUG,SH_AP_R(r),"groups_for_user() could not open group file: %s\n",grpfile); + return NULL; + } + + SH_AP_POOL* sp; +#ifdef SHIB_APACHE_13 + sp=ap_make_sub_pool(r->pool); +#else + if (apr_pool_create(&sp,r->pool) != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK,APLOG_ERR,0,r, + "groups_for_user() could not create a subpool"); + return NULL; + } +#endif + + while (!(ap_cfg_getline(l,MAX_STRING_LEN,f))) { + if ((*l=='#') || (!*l)) + continue; + ll = l; + ap_clear_pool(sp); + + group_name=ap_getword(sp,&ll,':'); + + while (*ll) { + w=ap_getword_conf(sp,&ll); + if (!strcmp(w,user)) { + ap_table_setn(grps,ap_pstrdup(r->pool,group_name),"in"); + break; + } + } + } + ap_cfg_closefile(f); + ap_destroy_pool(sp); + return grps; +} + +bool htAccessControl::checkAttribute(const SPRequest& request, const Attribute* attr, const char* toMatch, RegularExpression* re) const +{ + bool caseSensitive = attr->isCaseSensitive(); + const vector& vals = attr->getSerializedValues(); + for (vector::const_iterator v=vals.begin(); v!=vals.end(); ++v) { + if (re) { + auto_arrayptr trans(fromUTF8(v->c_str())); + if (re->matches(trans.get())) { + if (request.isPriorityEnabled(SPRequest::SPDebug)) + request.log(SPRequest::SPDebug, string("htaccess: expecting regexp ") + toMatch + ", got " + *v + ": acccepted"); + return true; + } + } + else if ((caseSensitive && *v == toMatch) || (!caseSensitive && !strcasecmp(v->c_str(), toMatch))) { + if (request.isPriorityEnabled(SPRequest::SPDebug)) + request.log(SPRequest::SPDebug, string("htaccess: expecting ") + toMatch + ", got " + *v + ": accepted"); + return true; + } + else if (request.isPriorityEnabled(SPRequest::SPDebug)) { + request.log(SPRequest::SPDebug, string("htaccess: expecting ") + toMatch + ", got " + *v + ": rejected"); + } + } + return false; +} + +AccessControl::aclresult_t htAccessControl::authorized(const SPRequest& request, const Session* session) const +{ + // Make sure the object is our type. + const ShibTargetApache* sta=dynamic_cast(&request); + if (!sta) + throw ConfigurationException("Request wrapper object was not of correct type."); + + // mod_auth clone + + int m=sta->m_req->method_number; + bool method_restricted=false; + const char *t, *w; + + const array_header* reqs_arr=ap_requires(sta->m_req); + if (!reqs_arr) + return shib_acl_indeterminate; // should never happen + + require_line* reqs=(require_line*)reqs_arr->elts; + + for (int x=0; xnelts; x++) { + // This rule should be completely ignored, the method doesn't fit. + // The rule just doesn't exist for our purposes. + if (!(reqs[x].method_mask & (1 << m))) + continue; + + method_restricted=true; // this lets us know at the end that at least one rule was potentially enforcable. + + // Tracks status of this rule's evaluation. + bool status = false; + + string remote_user = request.getRemoteUser(); + + t = reqs[x].requirement; + w = ap_getword_white(sta->m_req->pool, &t); + + if (!strcasecmp(w,"shibboleth")) { + // This is a dummy rule needed because Apache conflates authn and authz. + // Without some require rule, AuthType is ignored and no check_user hooks run. + status = true; // treat it as an "accepted" rule + } + else if (!strcmp(w,"valid-user") && session) { + request.log(SPRequest::SPDebug, "htaccess: accepting valid-user based on active session"); + status = true; + } + else if (!strcmp(w,"user") && !remote_user.empty()) { + bool regexp=false,negate=false; + while (*t) { + w=ap_getword_conf(sta->m_req->pool,&t); + if (*w=='~') { + regexp=true; + continue; + } + else if (*w=='!') { + negate=true; + if (*(w+1)=='~') + regexp=true; + continue; + } + + // Figure out if there's a match. + bool match = false; + if (regexp) { + try { + // To do regex matching, we have to convert from UTF-8. + auto_arrayptr trans(fromUTF8(w)); + RegularExpression re(trans.get()); + auto_arrayptr trans2(fromUTF8(remote_user.c_str())); + match = re.matches(trans2.get()); + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + request.log(SPRequest::SPError, + string("htaccess plugin caught exception while parsing regular expression (") + w + "): " + tmp.get()); + } + } + else if (remote_user==w) { + match = true; + } + + if (match) { + // If we matched, then we're done with this rule either way and status is set to reflect the outcome. + status = !negate; + if (request.isPriorityEnabled(SPRequest::SPDebug)) + request.log(SPRequest::SPDebug, + string("htaccess: require user ") + (negate ? "rejecting (" : "accepting (") + remote_user + ")"); + break; + } + } + } + else if (!strcmp(w,"group") && !remote_user.empty()) { + SH_AP_TABLE* grpstatus=NULL; + if (sta->m_dc->szAuthGrpFile) { + if (request.isPriorityEnabled(SPRequest::SPDebug)) + request.log(SPRequest::SPDebug,string("htaccess plugin using groups file: ") + sta->m_dc->szAuthGrpFile); + grpstatus=groups_for_user(sta->m_req,remote_user.c_str(),sta->m_dc->szAuthGrpFile); + } + + bool negate=false; + while (*t) { + w=ap_getword_conf(sta->m_req->pool,&t); + if (*w=='!') { + negate=true; + continue; + } + + if (grpstatus && ap_table_get(grpstatus,w)) { + // If we matched, then we're done with this rule either way and status is set to reflect the outcome. + status = !negate; + request.log(SPRequest::SPDebug, string("htaccess: require group ") + (negate ? "rejecting (" : "accepting (") + w + ")"); + break; + } + } + } + else if (!strcmp(w,"authnContextClassRef") || !strcmp(w,"authnContextDeclRef")) { + const char* ref = !strcmp(w,"authnContextClassRef") ? session->getAuthnContextClassRef() : session->getAuthnContextDeclRef(); + bool regexp=false,negate=false; + while (ref && *t) { + w=ap_getword_conf(sta->m_req->pool,&t); + if (*w=='~') { + regexp=true; + continue; + } + else if (*w=='!') { + negate=true; + if (*(w+1)=='~') + regexp=true; + continue; + } + + // Figure out if there's a match. + bool match = false; + if (regexp) { + try { + // To do regex matching, we have to convert from UTF-8. + RegularExpression re(w); + match = re.matches(ref); + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + request.log(SPRequest::SPError, + string("htaccess plugin caught exception while parsing regular expression (") + w + "): " + tmp.get()); + } + } + else if (!strcmp(w,ref)) { + match = true; + } + + if (match) { + // If we matched, then we're done with this rule either way and status is set to reflect the outcome. + status = !negate; + if (request.isPriorityEnabled(SPRequest::SPDebug)) + request.log(SPRequest::SPDebug, + string("htaccess: require authnContext ") + (negate ? "rejecting (" : "accepting (") + ref + ")"); + break; + } + } + } + else if (!session) { + request.log(SPRequest::SPError, string("htaccess: require ") + w + " not given a valid session, are you using lazy sessions?"); + } + else { + // Find the attribute(s) matching the require rule. + pair::const_iterator,multimap::const_iterator> attrs = + session->getIndexedAttributes().equal_range(w); + + bool regexp=false; + while (!status && attrs.first!=attrs.second && *t) { + w=ap_getword_conf(sta->m_req->pool,&t); + if (*w=='~') { + regexp=true; + continue; + } + + try { + auto_ptr re; + if (regexp) { + delete re.release(); + auto_arrayptr trans(fromUTF8(w)); + auto_ptr temp(new xercesc::RegularExpression(trans.get())); + re=temp; + } + + for (; !status && attrs.first!=attrs.second; ++attrs.first) { + if (checkAttribute(request, attrs.first->second, w, regexp ? re.get() : NULL)) { + status = true; + } + } + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + request.log(SPRequest::SPError, + string("htaccess plugin caught exception while parsing regular expression (") + w + "): " + tmp.get() + ); + } + } + } + + // If status is false, we found a rule we couldn't satisfy. + // Could be an unknown rule to us, or it just didn't match. + + if (status && sta->m_dc->bRequireAll != 1) { + // If we're not insisting that all rules be met, then we're done. + request.log(SPRequest::SPDebug, "htaccess: a rule was successful, granting access"); + return shib_acl_true; + } + else if (!status && sta->m_dc->bRequireAll == 1) { + // If we're insisting that all rules be met, which is not something Apache really handles well, + // then we either return false or indeterminate based on the authoritative option, which defaults on. + if (sta->m_dc->bAuthoritative != 0) { + request.log(SPRequest::SPDebug, "htaccess: a rule was unsuccessful, denying access"); + return shib_acl_false; + } + + request.log(SPRequest::SPDebug, "htaccess: a rule was unsuccessful but not authoritative, leaving it up to Apache"); + return shib_acl_indeterminate; + } + + // Otherwise, we keep going. If we're requring all, then we have to check every rule. + // If not we just didn't find a successful rule yet, so we keep going anyway. + } + + // If we get here, we either "failed" or we're in require all mode (but not both). + // If no rules possibly apply or we insisted that all rules check out, then we're good. + if (!method_restricted) { + request.log(SPRequest::SPDebug, "htaccess: no rules applied to this request method, granting access"); + return shib_acl_true; + } + else if (sta->m_dc->bRequireAll == 1) { + request.log(SPRequest::SPDebug, "htaccess: all rules successful, granting access"); + return shib_acl_true; + } + else if (sta->m_dc->bAuthoritative != 0) { + request.log(SPRequest::SPDebug, "htaccess: no rules were successful, denying access"); + return shib_acl_false; + } + + request.log(SPRequest::SPDebug, "htaccess: no rules were successful but not authoritative, leaving it up to Apache"); + return shib_acl_indeterminate; +} + + +// Initial look at a request - create the per-request structure +static int shib_post_read(request_rec *r) +{ + shib_request_config* rc = init_request_config(r); + + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r), "shib_post_read"); + +#ifdef SHIB_DEFERRED_HEADERS + rc->hdr_out = ap_make_table(r->pool, 5); +#endif + return DECLINED; +} + +// fixups: set environment vars + +extern "C" int shib_fixups(request_rec* r) +{ + shib_request_config *rc = (shib_request_config*)ap_get_module_config(r->request_config, &mod_shib); + shib_dir_config *dc = (shib_dir_config*)ap_get_module_config(r->per_dir_config, &mod_shib); + if (dc->bOff==1 || dc->bUseEnvVars==0) + return DECLINED; + + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r), "shib_fixup(%d): ENTER", (int)getpid()); + + if (rc==NULL || rc->env==NULL || ap_is_empty_table(rc->env)) + return DECLINED; + + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r), "shib_fixup adding %d vars", ap_table_elts(rc->env)->nelts); + r->subprocess_env = ap_overlay_tables(r->pool, r->subprocess_env, rc->env); + + return OK; +} + +#ifdef SHIB_APACHE_13 +/* + * shib_child_exit() + * Cleanup the (per-process) pool info. + */ +extern "C" void shib_child_exit(server_rec* s, SH_AP_POOL* p) +{ + if (g_Config) { + ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(s),"shib_child_exit(%d) dealing with g_Config..", (int)getpid()); + g_Config->term(); + g_Config = NULL; + ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(s),"shib_child_exit() done"); + } +} +#else +/* + * shib_exit() + * Apache 2.x doesn't allow for per-child cleanup, causes CGI forks to hang. + */ +extern "C" apr_status_t shib_exit(void* data) +{ + if (g_Config) { + g_Config->term(); + g_Config = NULL; + } + ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,0,NULL,"shib_exit() done"); + return OK; +} +#endif + +/* + * shire_child_init() + * Things to do when the child process is initialized. + * (or after the configs are read in apache-2) + */ +#ifdef SHIB_APACHE_13 +extern "C" void shib_child_init(server_rec* s, SH_AP_POOL* p) +#else +extern "C" void shib_child_init(apr_pool_t* p, server_rec* s) +#endif +{ + // Initialize runtime components. + + ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init(%d) starting", (int)getpid()); + + if (g_Config) { + ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() already initialized!"); + exit(1); + } + + g_Config=&SPConfig::getConfig(); + g_Config->setFeatures( + SPConfig::Listener | + SPConfig::Caching | + SPConfig::RequestMapping | + SPConfig::InProcess | + SPConfig::Logging | + SPConfig::Handlers + ); + if (!g_Config->init(g_szSchemaDir, g_szPrefix)) { + ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() failed to initialize libraries"); + exit(1); + } + g_Config->AccessControlManager.registerFactory(HT_ACCESS_CONTROL,&htAccessFactory); + g_Config->RequestMapperManager.registerFactory(NATIVE_REQUEST_MAPPER,&ApacheRequestMapFactory); + + if (!g_szSHIBConfig) + g_szSHIBConfig=getenv("SHIBSP_CONFIG"); + if (!g_szSHIBConfig) + g_szSHIBConfig=SHIBSP_CONFIG; + + try { + xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(g_szSHIBConfig); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + g_Config->getServiceProvider()->init(); + } + catch (exception& ex) { + ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),ex.what()); + ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() failed to load configuration"); + exit(1); + } + + ServiceProvider* sp=g_Config->getServiceProvider(); + xmltooling::Locker locker(sp); + const PropertySet* props=sp->getPropertySet("Local"); + if (props) { + pair unsetValue=props->getString("unsetHeaderValue"); + if (unsetValue.first) + g_unsetHeaderValue = unsetValue.second; + pair flag=props->getBool("checkSpoofing"); + g_checkSpoofing = !flag.first || flag.second; + flag=props->getBool("catchAll"); + g_catchAll = flag.first && flag.second; + } + + // Set the cleanup handler + apr_pool_cleanup_register(p, NULL, &shib_exit, apr_pool_cleanup_null); + + ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() done"); +} + +// Output filters +#ifdef SHIB_DEFERRED_HEADERS +static void set_output_filter(request_rec *r) +{ + ap_add_output_filter("SHIB_HEADERS_OUT", NULL, r, r->connection); +} + +static void set_error_filter(request_rec *r) +{ + ap_add_output_filter("SHIB_HEADERS_ERR", NULL, r, r->connection); +} + +static int _table_add(void *v, const char *key, const char *value) +{ + apr_table_addn((apr_table_t*)v, key, value); + return 1; +} + +static apr_status_t do_output_filter(ap_filter_t *f, apr_bucket_brigade *in) +{ + request_rec *r = f->r; + shib_request_config *rc = (shib_request_config*) ap_get_module_config(r->request_config, &mod_shib); + + if (rc) { + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r),"shib_out_filter: merging %d headers", apr_table_elts(rc->hdr_out)->nelts); + apr_table_do(_table_add,r->headers_out, rc->hdr_out,NULL); + // can't use overlap call because it will collapse Set-Cookie headers + //apr_table_overlap(r->headers_out, rc->hdr_out, APR_OVERLAP_TABLES_MERGE); + } + + /* remove ourselves from the filter chain */ + ap_remove_output_filter(f); + + /* send the data up the stack */ + return ap_pass_brigade(f->next,in); +} + +static apr_status_t do_error_filter(ap_filter_t *f, apr_bucket_brigade *in) +{ + request_rec *r = f->r; + shib_request_config *rc = (shib_request_config*) ap_get_module_config(r->request_config, &mod_shib); + + if (rc) { + ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r),"shib_err_filter: merging %d headers", apr_table_elts(rc->hdr_out)->nelts); + apr_table_do(_table_add,r->err_headers_out, rc->hdr_out,NULL); + // can't use overlap call because it will collapse Set-Cookie headers + //apr_table_overlap(r->err_headers_out, rc->hdr_out, APR_OVERLAP_TABLES_MERGE); + } + + /* remove ourselves from the filter chain */ + ap_remove_output_filter(f); + + /* send the data up the stack */ + return ap_pass_brigade(f->next,in); +} +#endif // SHIB_DEFERRED_HEADERS + +typedef const char* (*config_fn_t)(void); + +#ifdef SHIB_APACHE_13 + +// SHIB Module commands + +static command_rec shire_cmds[] = { + {"ShibPrefix", (config_fn_t)ap_set_global_string_slot, &g_szPrefix, + RSRC_CONF, TAKE1, "Shibboleth installation directory"}, + {"ShibConfig", (config_fn_t)ap_set_global_string_slot, &g_szSHIBConfig, + RSRC_CONF, TAKE1, "Path to shibboleth.xml config file"}, + {"ShibCatalogs", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir, + RSRC_CONF, TAKE1, "Paths of XML schema catalogs"}, + {"ShibSchemaDir", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir, + RSRC_CONF, TAKE1, "Paths of XML schema catalogs (deprecated in favor of ShibCatalogs)"}, + + {"ShibURLScheme", (config_fn_t)shib_set_server_string_slot, + (void *) XtOffsetOf (shib_server_config, szScheme), + RSRC_CONF, TAKE1, "URL scheme to force into generated URLs for a vhost"}, + + {"ShibRequestSetting", (config_fn_t)shib_table_set, NULL, + OR_AUTHCFG, TAKE2, "Set arbitrary Shibboleth request property for content"}, + + {"ShibDisable", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bOff), + OR_AUTHCFG, FLAG, "Disable all Shib module activity here to save processing effort"}, + {"ShibApplicationId", (config_fn_t)ap_set_string_slot, + (void *) XtOffsetOf (shib_dir_config, szApplicationId), + OR_AUTHCFG, TAKE1, "Set Shibboleth applicationId property for content"}, + {"ShibBasicHijack", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bBasicHijack), + OR_AUTHCFG, FLAG, "Respond to AuthType Basic and convert to shibboleth"}, + {"ShibRequireSession", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bRequireSession), + OR_AUTHCFG, FLAG, "Initiates a new session if one does not exist"}, + {"ShibRequireSessionWith", (config_fn_t)ap_set_string_slot, + (void *) XtOffsetOf (shib_dir_config, szRequireWith), + OR_AUTHCFG, TAKE1, "Initiates a new session if one does not exist using a specific SessionInitiator"}, + {"ShibExportAssertion", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bExportAssertion), + OR_AUTHCFG, FLAG, "Export SAML attribute assertion(s) to Shib-Attributes header"}, + {"ShibRedirectToSSL", (config_fn_t)ap_set_string_slot, + (void *) XtOffsetOf (shib_dir_config, szRedirectToSSL), + OR_AUTHCFG, TAKE1, "Redirect non-SSL requests to designated port" }, + {"AuthGroupFile", (config_fn_t)shib_ap_set_file_slot, + (void *) XtOffsetOf (shib_dir_config, szAuthGrpFile), + OR_AUTHCFG, TAKE1, "text file containing group names and member user IDs"}, + {"ShibRequireAll", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bRequireAll), + OR_AUTHCFG, FLAG, "All require directives must match"}, + {"AuthzShibAuthoritative", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bAuthoritative), + OR_AUTHCFG, FLAG, "Allow failed mod_shib htaccess authorization to fall through to other modules"}, + {"ShibUseEnvironment", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bUseEnvVars), + OR_AUTHCFG, FLAG, "Export attributes using environment variables (default)"}, + {"ShibUseHeaders", (config_fn_t)ap_set_flag_slot, + (void *) XtOffsetOf (shib_dir_config, bUseHeaders), + OR_AUTHCFG, FLAG, "Export attributes using custom HTTP headers"}, + + {NULL} +}; + +extern "C"{ +handler_rec shib_handlers[] = { + { "shib-handler", shib_handler }, + { NULL } +}; + +module MODULE_VAR_EXPORT mod_shib = { + STANDARD_MODULE_STUFF, + NULL, /* initializer */ + create_shib_dir_config, /* dir config creater */ + merge_shib_dir_config, /* dir merger --- default is to override */ + create_shib_server_config, /* server config */ + merge_shib_server_config, /* merge server config */ + shire_cmds, /* command table */ + shib_handlers, /* handlers */ + NULL, /* filename translation */ + shib_check_user, /* check_user_id */ + shib_auth_checker, /* check auth */ + NULL, /* check access */ + NULL, /* type_checker */ + shib_fixups, /* fixups */ + NULL, /* logger */ + NULL, /* header parser */ + shib_child_init, /* child_init */ + shib_child_exit, /* child_exit */ + shib_post_read /* post read-request */ +}; + +#elif defined(SHIB_APACHE_20) || defined(SHIB_APACHE_22) + +extern "C" void shib_register_hooks (apr_pool_t *p) +{ +#ifdef SHIB_DEFERRED_HEADERS + ap_register_output_filter("SHIB_HEADERS_OUT", do_output_filter, NULL, AP_FTYPE_CONTENT_SET); + ap_hook_insert_filter(set_output_filter, NULL, NULL, APR_HOOK_LAST); + ap_register_output_filter("SHIB_HEADERS_ERR", do_error_filter, NULL, AP_FTYPE_CONTENT_SET); + ap_hook_insert_error_filter(set_error_filter, NULL, NULL, APR_HOOK_LAST); + ap_hook_post_read_request(shib_post_read, NULL, NULL, APR_HOOK_MIDDLE); +#endif + ap_hook_child_init(shib_child_init, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_check_user_id(shib_check_user, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_auth_checker(shib_auth_checker, NULL, NULL, APR_HOOK_FIRST); + ap_hook_handler(shib_handler, NULL, NULL, APR_HOOK_LAST); + ap_hook_fixups(shib_fixups, NULL, NULL, APR_HOOK_MIDDLE); +} + +// SHIB Module commands + +extern "C" { +static command_rec shib_cmds[] = { + AP_INIT_TAKE1("ShibPrefix", (config_fn_t)ap_set_global_string_slot, &g_szPrefix, + RSRC_CONF, "Shibboleth installation directory"), + AP_INIT_TAKE1("ShibConfig", (config_fn_t)ap_set_global_string_slot, &g_szSHIBConfig, + RSRC_CONF, "Path to shibboleth.xml config file"), + AP_INIT_TAKE1("ShibCatalogs", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir, + RSRC_CONF, "Paths of XML schema catalogs"), + AP_INIT_TAKE1("ShibSchemaDir", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir, + RSRC_CONF, "Paths of XML schema catalogs (deprecated in favor of ShibCatalogs)"), + + AP_INIT_TAKE1("ShibURLScheme", (config_fn_t)shib_set_server_string_slot, + (void *) offsetof (shib_server_config, szScheme), + RSRC_CONF, "URL scheme to force into generated URLs for a vhost"), + + AP_INIT_TAKE2("ShibRequestSetting", (config_fn_t)shib_table_set, NULL, + OR_AUTHCFG, "Set arbitrary Shibboleth request property for content"), + + AP_INIT_FLAG("ShibDisable", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bOff), + OR_AUTHCFG, "Disable all Shib module activity here to save processing effort"), + AP_INIT_TAKE1("ShibApplicationId", (config_fn_t)ap_set_string_slot, + (void *) offsetof (shib_dir_config, szApplicationId), + OR_AUTHCFG, "Set Shibboleth applicationId property for content"), + AP_INIT_FLAG("ShibBasicHijack", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bBasicHijack), + OR_AUTHCFG, "Respond to AuthType Basic and convert to shibboleth"), + AP_INIT_FLAG("ShibRequireSession", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bRequireSession), + OR_AUTHCFG, "Initiates a new session if one does not exist"), + AP_INIT_TAKE1("ShibRequireSessionWith", (config_fn_t)ap_set_string_slot, + (void *) offsetof (shib_dir_config, szRequireWith), + OR_AUTHCFG, "Initiates a new session if one does not exist using a specific SessionInitiator"), + AP_INIT_FLAG("ShibExportAssertion", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bExportAssertion), + OR_AUTHCFG, "Export SAML attribute assertion(s) to Shib-Attributes header"), + AP_INIT_TAKE1("ShibRedirectToSSL", (config_fn_t)ap_set_string_slot, + (void *) offsetof (shib_dir_config, szRedirectToSSL), + OR_AUTHCFG, "Redirect non-SSL requests to designated port"), + AP_INIT_TAKE1("AuthGroupFile", (config_fn_t)shib_ap_set_file_slot, + (void *) offsetof (shib_dir_config, szAuthGrpFile), + OR_AUTHCFG, "Text file containing group names and member user IDs"), + AP_INIT_FLAG("ShibRequireAll", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bRequireAll), + OR_AUTHCFG, "All require directives must match"), + AP_INIT_FLAG("AuthzShibAuthoritative", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bAuthoritative), + OR_AUTHCFG, "Allow failed mod_shib htaccess authorization to fall through to other modules"), + AP_INIT_FLAG("ShibUseEnvironment", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bUseEnvVars), + OR_AUTHCFG, "Export attributes using environment variables (default)"), + AP_INIT_FLAG("ShibUseHeaders", (config_fn_t)ap_set_flag_slot, + (void *) offsetof (shib_dir_config, bUseHeaders), + OR_AUTHCFG, "Export attributes using custom HTTP headers"), + + {NULL} +}; + +module AP_MODULE_DECLARE_DATA mod_shib = { + STANDARD20_MODULE_STUFF, + create_shib_dir_config, /* create dir config */ + merge_shib_dir_config, /* merge dir config --- default is to override */ + create_shib_server_config, /* create server config */ + merge_shib_server_config, /* merge server config */ + shib_cmds, /* command table */ + shib_register_hooks /* register hooks */ +}; + +#else +#error "unsupported Apache version" +#endif + +} diff --git a/apache/mod_shib13.vcproj b/apache/mod_shib13.vcproj new file mode 100644 index 0000000..c259b88 --- /dev/null +++ b/apache/mod_shib13.vcproj @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apache/mod_shib20.vcproj b/apache/mod_shib20.vcproj new file mode 100644 index 0000000..149615d --- /dev/null +++ b/apache/mod_shib20.vcproj @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apache/mod_shib22.vcproj b/apache/mod_shib22.vcproj new file mode 100644 index 0000000..c08f802 --- /dev/null +++ b/apache/mod_shib22.vcproj @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apache/mod_shib_13.cpp b/apache/mod_shib_13.cpp new file mode 100644 index 0000000..d3c7a00 --- /dev/null +++ b/apache/mod_shib_13.cpp @@ -0,0 +1,39 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* mod_shib_13.cpp -- a wrapper around the apache module code to + * build for Apache 1.3 + * + * Created by: Derek Atkins + * + */ + +#define SHIB_APACHE_13 1 + +#define SH_AP_POOL pool +#define SH_AP_TABLE table +#define SH_AP_CONFIGFILE configfile_t +#define SH_AP_R(r) r +#define SH_AP_USER(r) r->connection->user + +#ifdef WIN32 +# define _USE_32BIT_TIME_T +#endif + +#define apr_pool_userdata_setn(n,k,d,p) +#define apr_pool_cleanup_register(p1,p2,f,d) + +#include "mod_apache.cpp" diff --git a/apache/mod_shib_13.rc b/apache/mod_shib_13.rc new file mode 100644 index 0000000..a352d58 --- /dev/null +++ b/apache/mod_shib_13.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth Apache 1.3 Module\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "mod_shib_13\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "mod_shib_13.so\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/apache/mod_shib_20.cpp b/apache/mod_shib_20.cpp new file mode 100644 index 0000000..065b24e --- /dev/null +++ b/apache/mod_shib_20.cpp @@ -0,0 +1,62 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* mod_shib_20.cpp -- a wrapper around the apache module code to + * build for Apache 2.0 + * + * Created by: Derek Atkins + * + */ + +#define SHIB_APACHE_20 1 + +#define MODULE_VAR_EXPORT AP_MODULE_DECLARE_DATA +#define SH_AP_POOL apr_pool_t +#define SH_AP_TABLE apr_table_t +#define SH_AP_CONFIGFILE ap_configfile_t +#define array_header apr_array_header_t + +#define SH_AP_R(r) 0,r +#define SH_AP_USER(r) r->user + +#define SERVER_ERROR HTTP_INTERNAL_SERVER_ERROR +#define REDIRECT HTTP_MOVED_TEMPORARILY +#define ap_pcalloc apr_pcalloc +#define ap_pstrdup apr_pstrdup +#define ap_pstrcat apr_pstrcat +#define ap_psprintf apr_psprintf +#define ap_table_get apr_table_get +#define ap_table_add apr_table_add +#define ap_table_addn apr_table_addn +#define ap_table_setn apr_table_setn +#define ap_table_unset apr_table_unset +#define ap_table_set apr_table_set +#define ap_clear_pool apr_pool_clear +#define ap_destroy_pool apr_pool_destroy +#define ap_make_table apr_table_make +#define ap_copy_table apr_table_copy +#define ap_overlay_tables apr_table_overlay +#define ap_overlap_tables apr_table_overlap +#define ap_table_elts apr_table_elts +#define ap_is_empty_table apr_is_empty_table +#define AP_OVERLAP_TABLES_SET APR_OVERLAP_TABLES_SET + +#define ap_send_http_header(r) +#define ap_hard_timeout(str,r) +#define ap_reset_timeout(r) +#define ap_kill_timeout(r) + +#include "mod_apache.cpp" diff --git a/apache/mod_shib_20.rc b/apache/mod_shib_20.rc new file mode 100644 index 0000000..ead4cdf --- /dev/null +++ b/apache/mod_shib_20.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth Apache 2.0 Module\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "mod_shib_20\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "mod_shib_20.so\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/apache/mod_shib_22.cpp b/apache/mod_shib_22.cpp new file mode 100644 index 0000000..5cab9e4 --- /dev/null +++ b/apache/mod_shib_22.cpp @@ -0,0 +1,64 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* mod_shib_22.cpp -- a wrapper around the apache module code to + * build for Apache 2.2 + * + * Created by: Scott Cantor + * + */ + +#define SHIB_APACHE_22 1 + +#define MODULE_VAR_EXPORT AP_MODULE_DECLARE_DATA +#define SH_AP_POOL apr_pool_t +#define SH_AP_TABLE apr_table_t +#define SH_AP_CONFIGFILE ap_configfile_t +#define array_header apr_array_header_t + +#define SH_AP_R(r) 0,r +#define SH_AP_USER(r) r->user + +#define SERVER_ERROR HTTP_INTERNAL_SERVER_ERROR +#define REDIRECT HTTP_MOVED_TEMPORARILY +#define ap_pcalloc apr_pcalloc +#define ap_pstrdup apr_pstrdup +#define ap_pstrcat apr_pstrcat +#define ap_psprintf apr_psprintf +#define ap_table_get apr_table_get +#define ap_table_add apr_table_add +#define ap_table_addn apr_table_addn +#define ap_table_setn apr_table_setn +#define ap_table_unset apr_table_unset +#define ap_table_set apr_table_set +#define ap_copy_table apr_table_copy +#define ap_overlay_tables apr_table_overlay +#define ap_overlap_tables apr_table_overlap +#define ap_table_elts apr_table_elts +#define ap_is_empty_table apr_is_empty_table +#define ap_clear_pool apr_pool_clear +#define ap_destroy_pool apr_pool_destroy +#define ap_make_table apr_table_make +#define AP_OVERLAP_TABLES_SET APR_OVERLAP_TABLES_SET + +#define ap_send_http_header(r) +#define ap_hard_timeout(str,r) +#define ap_reset_timeout(r) +#define ap_kill_timeout(r) + +#define ap_http_method ap_http_scheme + +#include "mod_apache.cpp" diff --git a/apache/mod_shib_22.rc b/apache/mod_shib_22.rc new file mode 100644 index 0000000..c8c44cd --- /dev/null +++ b/apache/mod_shib_22.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth Apache 2.2 Module\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "mod_shib_22\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "mod_shib_22.so\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/apache/resource.h b/apache/resource.h new file mode 100644 index 0000000..547174f --- /dev/null +++ b/apache/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by mod_shib_20.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..2fc3acc --- /dev/null +++ b/config.guess @@ -0,0 +1,1411 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-06-17' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +## for Red Hat Linux +if test -f /etc/redhat-release ; then + VENDOR=redhat ; +else + VENDOR= ; +fi + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu + exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..0d29263 --- /dev/null +++ b/config.h.in @@ -0,0 +1,126 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if ctime_r is present with 2 parameters. */ +#undef HAVE_CTIME_R_2 + +/* Define if ctime_r is present with 3 parameters. */ +#undef HAVE_CTIME_R_3 + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#undef HAVE_DECL_STRERROR_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `gmtime_r' function. */ +#undef HAVE_GMTIME_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if Xerces-C library was found */ +#undef HAVE_LIBXERCESC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* define if the compiler implements namespaces */ +#undef HAVE_NAMESPACES + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Define if saml library was found */ +#undef HAVE_SAML + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror_r' function. */ +#undef HAVE_STRERROR_R + +/* Define to 1 if you have the `strftime' function. */ +#undef HAVE_STRFTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtok_r' function. */ +#undef HAVE_STRTOK_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the `timegm' function. */ +#undef HAVE_TIMEGM + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* Define if log4cpp library is used. */ +#undef SHIBSP_LOG4CPP + +/* Define if log4shib library is used. */ +#undef SHIBSP_LOG4SHIB + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if strerror_r returns char *. */ +#undef STRERROR_R_CHAR_P + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..6b2ff9f --- /dev/null +++ b/config.sub @@ -0,0 +1,1500 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-06-18' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config_win32.h b/config_win32.h new file mode 100644 index 0000000..57a9ec7 --- /dev/null +++ b/config_win32.h @@ -0,0 +1,138 @@ +/* config.h. Generated by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#define HAVE_DECL_STRERROR_R 0 + +/* Define to 1 if you have the declaration of `svcfd_create', and to 0 if you + don't. */ +#define HAVE_DECL_SVCFD_CREATE 1 + +/* Define to 1 if you have the declaration of `sys_errlist', and to 0 if you + don't. */ +/* #undef HAVE_DECL_SYS_ERRLIST */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the `gmtime_r' function. */ +/* #undef HAVE_GMTIME_R */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#define HAVE_LIBCRYPTO 1 + +/* Define to 1 if you have the `dmallocxx' library (-ldmallocxx). */ +/* #undef HAVE_LIBDMALLOCXX */ + +/* Define if log4shib library is used. */ +#define SHIBSP_LOG4SHIB 1 + +/* Define if log4cpp library is used. */ +/* #undef SHIBSP_LOG4CPP */ + +/* Define to 1 if you have the `ssl' library (-lssl). */ +#define HAVE_LIBSSL 1 + +/* Define if Xerces-C library was found */ +#define HAVE_LIBXERCESC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define if you have POSIX threads libraries and header files. */ +/* #undef HAVE_PTHREAD */ + +/* Define if saml library was found */ +#define HAVE_SAML 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strstr' function. */ +#define HAVE_STRSTR 1 + +/* Define to 1 if you have the `strtok_r' function. */ +/* #undef HAVE_STRTOK_R */ + +/* Define to 1 if the system has the type `struct rpcent'. */ +/* #undef HAVE_STRUCT_RPCENT */ + +/* Define to 1 if you have the `strerror_r' function. */ +/* #undef HAVE_STRERROR_R */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `timegm' function. */ +/* #undef HAVE_TIMEGM */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Name of package */ +#define PACKAGE "shibboleth" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "shibboleth-users@internet2.edu" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "shibboleth" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "shibboleth 2.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "shibboleth" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.0" + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Version number of package */ +#define VERSION "2.0" + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ diff --git a/configs/Makefile.am b/configs/Makefile.am new file mode 100644 index 0000000..d745b5d --- /dev/null +++ b/configs/Makefile.am @@ -0,0 +1,140 @@ +## $Id: Makefile.am 2779 2008-03-15 03:54:53Z cantor $ + +AUTOMAKE_OPTIONS = foreign + +pkglibdir = ${libdir}/@PACKAGE@ +pkglogdir = ${localstatedir}/log/@PACKAGE@ +pkgdocdir = ${datadir}/doc/@PACKAGE@ +shirelogdir = ${localstatedir}/log/httpd +pkgxmldir = $(datadir)/xml/@PACKAGE@ +pkgrundir = $(localstatedir)/run/@PACKAGE@ +pkgsysconfdir = $(sysconfdir)/@PACKAGE@ +pkgsysconf_DATA = \ + shibd-redhat \ + shibd-debian \ + shibd-osx.plist \ + apache.config \ + apache2.config \ + apache22.config \ + keygen.sh \ + upgrade.xsl + +# The config files are installed "special". Unlike the entries in +# pkgsysconf_DATA, these files are installed as "foo.dist" and only +# installed as "foo" if "foo" does not already exist. In other words, +# the config files will not overwrite existing versions. +BUILTCONFIGFILES = \ + native.logger \ + shibd.logger + +# While BUILTCONFIGFILES are processed, these are not; so we should pull +# them from SRCDIR. +CONFIGFILES = \ + shibboleth2.xml \ + attribute-map.xml \ + attribute-policy.xml \ + example-metadata.xml \ + console.logger \ + syslog.logger \ + accessError.html \ + sessionError.html \ + metadataError.html \ + bindingTemplate.html \ + discoveryTemplate.html \ + localLogout.html \ + globalLogout.html \ + sslError.html + +# +# Some of these need building +# +do-build-file: + rm -f ${FILE}.tmp + sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \ + -e 's:@-PREFIX-@:${prefix}:g' \ + -e 's:@-PKGLIBDIR-@:${pkglibdir}:g' \ + -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \ + -e 's:@-PKGDOCDIR-@:${pkgdocdir}:g' \ + -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \ + -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \ + -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \ + -e 's:@-PKGRUNDIR-@:${pkgrundir}:g' + cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE} + rm -f ${FILE}.tmp + +apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +all-data-local: $(BUILTCONFIGFILES) + +install-data-local: all-data-local + $(mkinstalldirs) $(DESTDIR)$(pkglogdir) + $(mkinstalldirs) $(DESTDIR)$(pkgdocdir) + $(mkinstalldirs) $(DESTDIR)$(shirelogdir) + $(mkinstalldirs) $(DESTDIR)$(pkgrundir) + $(mkinstalldirs) $(DESTDIR)$(pkgxmldir) + $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir) + for f in $(BUILTCONFIGFILES); do \ + if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \ + $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \ + fi; \ + $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \ + done + for f in $(CONFIGFILES); do \ + if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \ + $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \ + fi; \ + $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \ + done + +install-data-hook: + if test -z "$(NOKEYGEN)"; then \ + cd $(DESTDIR)$(pkgsysconfdir); \ + sh ./keygen.sh -b ; \ + fi + +CLEANFILES = \ + apache.config \ + apache2.config \ + apache22.config \ + shibd-redhat \ + shibd-debian \ + shibd-osx.plist \ + shibd.logger \ + native.logger + +EXTRA_DIST = \ + native.logger.in \ + shibd.logger.in \ + apache.config.in \ + apache2.config.in \ + apache22.config.in \ + shibd-redhat.in \ + shibd-debian.in \ + shibd-osx.plist.in \ + keygen.bat \ + keygen.sh \ + upgrade.xsl \ + xsltproc.js \ + $(CONFIGFILES) diff --git a/configs/Makefile.in b/configs/Makefile.in new file mode 100644 index 0000000..6e48ffb --- /dev/null +++ b/configs/Makefile.in @@ -0,0 +1,580 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = configs +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgsysconfdir)" +pkgsysconfDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgsysconf_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = ${libdir}/@PACKAGE@ +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +pkglogdir = ${localstatedir}/log/@PACKAGE@ +pkgdocdir = ${datadir}/doc/@PACKAGE@ +shirelogdir = ${localstatedir}/log/httpd +pkgxmldir = $(datadir)/xml/@PACKAGE@ +pkgrundir = $(localstatedir)/run/@PACKAGE@ +pkgsysconfdir = $(sysconfdir)/@PACKAGE@ +pkgsysconf_DATA = \ + shibd-redhat \ + shibd-debian \ + shibd-osx.plist \ + apache.config \ + apache2.config \ + apache22.config \ + keygen.sh \ + upgrade.xsl + + +# The config files are installed "special". Unlike the entries in +# pkgsysconf_DATA, these files are installed as "foo.dist" and only +# installed as "foo" if "foo" does not already exist. In other words, +# the config files will not overwrite existing versions. +BUILTCONFIGFILES = \ + native.logger \ + shibd.logger + + +# While BUILTCONFIGFILES are processed, these are not; so we should pull +# them from SRCDIR. +CONFIGFILES = \ + shibboleth2.xml \ + attribute-map.xml \ + attribute-policy.xml \ + example-metadata.xml \ + console.logger \ + syslog.logger \ + accessError.html \ + sessionError.html \ + metadataError.html \ + bindingTemplate.html \ + discoveryTemplate.html \ + localLogout.html \ + globalLogout.html \ + sslError.html + +CLEANFILES = \ + apache.config \ + apache2.config \ + apache22.config \ + shibd-redhat \ + shibd-debian \ + shibd-osx.plist \ + shibd.logger \ + native.logger + +EXTRA_DIST = \ + native.logger.in \ + shibd.logger.in \ + apache.config.in \ + apache2.config.in \ + apache22.config.in \ + shibd-redhat.in \ + shibd-debian.in \ + shibd-osx.plist.in \ + keygen.bat \ + keygen.sh \ + upgrade.xsl \ + xsltproc.js \ + $(CONFIGFILES) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign configs/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign configs/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-pkgsysconfDATA: $(pkgsysconf_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgsysconfdir)" || $(mkdir_p) "$(DESTDIR)$(pkgsysconfdir)" + @list='$(pkgsysconf_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgsysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgsysconfdir)/$$f'"; \ + $(pkgsysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgsysconfdir)/$$f"; \ + done + +uninstall-pkgsysconfDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgsysconf_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgsysconfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgsysconfdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkgsysconfdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-data-local install-pkgsysconfDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkgsysconfDATA + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-hook \ + install-data-local install-exec install-exec-am install-info \ + install-info-am install-man install-pkgsysconfDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-info-am \ + uninstall-pkgsysconfDATA + + +# +# Some of these need building +# +do-build-file: + rm -f ${FILE}.tmp + sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \ + -e 's:@-PREFIX-@:${prefix}:g' \ + -e 's:@-PKGLIBDIR-@:${pkglibdir}:g' \ + -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \ + -e 's:@-PKGDOCDIR-@:${pkgdocdir}:g' \ + -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \ + -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \ + -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \ + -e 's:@-PKGRUNDIR-@:${pkgrundir}:g' + cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE} + rm -f ${FILE}.tmp + +apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +all-data-local: $(BUILTCONFIGFILES) + +install-data-local: all-data-local + $(mkinstalldirs) $(DESTDIR)$(pkglogdir) + $(mkinstalldirs) $(DESTDIR)$(pkgdocdir) + $(mkinstalldirs) $(DESTDIR)$(shirelogdir) + $(mkinstalldirs) $(DESTDIR)$(pkgrundir) + $(mkinstalldirs) $(DESTDIR)$(pkgxmldir) + $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir) + for f in $(BUILTCONFIGFILES); do \ + if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \ + $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \ + fi; \ + $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \ + done + for f in $(CONFIGFILES); do \ + if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \ + $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \ + fi; \ + $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \ + done + +install-data-hook: + if test -z "$(NOKEYGEN)"; then \ + cd $(DESTDIR)$(pkgsysconfdir); \ + sh ./keygen.sh -b ; \ + fi +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/configs/accessError.html b/configs/accessError.html new file mode 100644 index 0000000..546ea4f --- /dev/null +++ b/configs/accessError.html @@ -0,0 +1,27 @@ + + + + + + + + Authorization Failed + + + + +Logo +

Authorization Failed

+ +Based on the information provided to this application about you, you are +not authorized to access the resource at "" + +

+ +Please contact the administrator of this service or application if you +believe this to be an error at + + + diff --git a/configs/apache.config.in b/configs/apache.config.in new file mode 100644 index 0000000..bce4a7e --- /dev/null +++ b/configs/apache.config.in @@ -0,0 +1,52 @@ +# RPM installations on platforms with a conf.d directory will +# result in this file being copied into that directory for you. +# For non-RPM installs, you can add this file to your +# configuration using an Include command in httpd.conf + +###### +## SHIB Config +###### + +# +# Load the Shibboleth module. +# +LoadModule mod_shib @-PKGLIBDIR-@/mod_shib_13.so + +# +# An Apache handler needs to be established for the "handler" location. +# This applies the handler to any requests for a resource with a ".sso" +# extension. +# + +SetHandler shib-handler + +# +# Another way of addressing this is to apply Shibboleth +# globally to the site in "lazy" session mode: +# +# AuthType shibboleth +# require shibboleth +# + +# +# Used for example logo and style sheet in error templates. +# + + Alias /shibboleth-sp/main.css @-PKGDOCDIR-@/main.css + Alias /shibboleth-sp/logo.jpg @-PKGDOCDIR-@/logo.jpg + + +# +# Configure the module for content +# +# You can now do most of this in shibboleth.xml using the RequestMap +# but you MUST enable AuthType shibboleth for the module to process +# any requests, and there MUST be a require command as well. To +# enable Shibboleth but not specify any session/access requirements +# use "require shibboleth". +# + + AuthType shibboleth + ShibRequireSession On + require valid-user + diff --git a/configs/apache2.config.in b/configs/apache2.config.in new file mode 100644 index 0000000..7ea0bb7 --- /dev/null +++ b/configs/apache2.config.in @@ -0,0 +1,39 @@ +# RPM installations on platforms with a conf.d directory will +# result in this file being copied into that directory for you. +# For non-RPM installs, you can add this file to your +# configuration using an Include command in httpd.conf + +###### +## SHIB Config +###### + +# +# Load the SHIBBOLETH module +# +LoadModule mod_shib @-PKGLIBDIR-@/mod_shib_20.so + +# +# Used for example logo and style sheet in error templates. +# + + + Allow from all + + Alias /shibboleth-sp/main.css @-PKGDOCDIR-@/main.css + Alias /shibboleth-sp/logo.jpg @-PKGDOCDIR-@/logo.jpg + + +# +# Configure the module for content +# +# You can now do most of this in shibboleth.xml using the RequestMap +# but you MUST enable AuthType shibboleth for the module to process +# any requests, and there MUST be a require command as well. To +# enable Shibboleth but not specify any session/access requirements +# use "require shibboleth". +# + + AuthType shibboleth + ShibRequireSession On + require valid-user + diff --git a/configs/apache22.config.in b/configs/apache22.config.in new file mode 100644 index 0000000..6823db5 --- /dev/null +++ b/configs/apache22.config.in @@ -0,0 +1,39 @@ +# RPM installations on platforms with a conf.d directory will +# result in this file being copied into that directory for you. +# For non-RPM installs, you can add this file to your +# configuration using an Include command in httpd.conf + +###### +## SHIB Config +###### + +# +# Load the SHIBBOLETH module +# +LoadModule mod_shib @-PKGLIBDIR-@/mod_shib_22.so + +# +# Used for example logo and style sheet in error templates. +# + + + Allow from all + + Alias /shibboleth-sp/main.css @-PKGDOCDIR-@/main.css + Alias /shibboleth-sp/logo.jpg @-PKGDOCDIR-@/logo.jpg + + +# +# Configure the module for content +# +# You can now do most of this in shibboleth.xml using the RequestMap +# but you MUST enable AuthType shibboleth for the module to process +# any requests, and there MUST be a require command as well. To +# enable Shibboleth but not specify any session/access requirements +# use "require shibboleth". +# + + AuthType shibboleth + ShibRequireSession On + require valid-user + diff --git a/configs/attribute-map.xml b/configs/attribute-map.xml new file mode 100644 index 0000000..090f804 --- /dev/null +++ b/configs/attribute-map.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/attribute-policy.xml b/configs/attribute-policy.xml new file mode 100644 index 0000000..c19ed16 --- /dev/null +++ b/configs/attribute-policy.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/bindingTemplate.html b/configs/bindingTemplate.html new file mode 100644 index 0000000..59a924b --- /dev/null +++ b/configs/bindingTemplate.html @@ -0,0 +1,58 @@ + + + Shibboleth Authentication Request + + + +

Shibboleth Authentication Request

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/configs/console.logger b/configs/console.logger new file mode 100644 index 0000000..06fadfd --- /dev/null +++ b/configs/console.logger @@ -0,0 +1,31 @@ +log4j.rootCategory=WARN, console + +# fairly verbose for DEBUG, so generally leave at INFO +log4j.category.XMLTooling.XMLObject=INFO +log4j.category.XMLTooling.KeyInfoResolver=INFO +log4j.category.Shibboleth.PropertySet=INFO + +# raise for low-level tracing of SOAP client HTTP/SSL behavior +log4j.category.XMLTooling.libcurl=INFO + +# useful categories to tune independently: +# +# tracing of SAML messages and security policies +#log4j.category.OpenSAML.MessageDecoder=DEBUG +#log4j.category.OpenSAML.MessageEncoder=DEBUG +#log4j.category.OpenSAML.SecurityPolicyRule=DEBUG +# interprocess message remoting +#log4j.category.Shibboleth.Listener=DEBUG +# mapping of requests to applicationId +#log4j.category.Shibboleth.RequestMapper=DEBUG +# high level session cache operations +#log4j.category.Shibboleth.SessionCache=DEBUG +# persistent storage and caching +#log4j.category.XMLTooling.StorageService=DEBUG + +# define the appender + +log4j.appender.console=org.apache.log4j.ConsoleAppender +#log4j.appender.console.layout=org.apache.log4j.BasicLayout +log4j.appender.console.layout=org.apache.log4j.PatternLayout +log4j.appender.console.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %p %c %x: %m%n diff --git a/configs/discoveryTemplate.html b/configs/discoveryTemplate.html new file mode 100644 index 0000000..75f8d8d --- /dev/null +++ b/configs/discoveryTemplate.html @@ -0,0 +1,44 @@ + + + Request for Authentication + + +

Request for Authentication

+ +

This web site requires you to login before proceeding. Please identify + the domain name of your organization:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

The system was unable to determine how to proceed using the value you supplied.

+
+ + diff --git a/configs/example-metadata.xml b/configs/example-metadata.xml new file mode 100644 index 0000000..be7bf43 --- /dev/null +++ b/configs/example-metadata.xml @@ -0,0 +1,195 @@ + + + + + + + + + + example.org + + + + + + + + MIICkjCCAfugAwIBAgIJAK7VCxPsh8yrMA0GCSqGSIb3DQEBBAUAMDsxCzAJBgNV + BAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxl + Lm9yZzAeFw0wNTA2MjAxNTUwNDFaFw0zMjExMDUxNTUwNDFaMDsxCzAJBgNVBAYT + AlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxlLm9y + ZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2VnUvWYrNhtRUqIxAuFmV8YP + Jhr+OMKJpc/RaEs2C8mk5N5qO+ysClg2cVfkws3O4Lc15AiNdQ0s3ZijYwJK2EEg + 4vmoTl2RrjP1b3PK2h+VbUuYny9enHwDL+Z4bjP/8nmIKlhUSq4DTGXbwdQiWjCd + lQXvDtvHRwX/TaqtHbcCAwEAAaOBnTCBmjAdBgNVHQ4EFgQUlmI7WqzIDJzcfAyU + v2kmk3p9sbAwawYDVR0jBGQwYoAUlmI7WqzIDJzcfAyUv2kmk3p9sbChP6Q9MDsx + CzAJBgNVBAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5l + eGFtcGxlLm9yZ4IJAK7VCxPsh8yrMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE + BQADgYEAsatF5gh1ZBF1QuXxchKp2BKVOsK+23y+FqhuOuVi/PTMf+Li84Ih25Al + Jyy3OKc0oprM6tCJaiSooy32KTW6a1xhPm2MwuXzD33SPoKItue/ndp8Bhx/PO9U + w14fpgtAk2x8xD7cpHsZ073JHxEcjEetD8PTtrFdNu6GwIrv6Sk= + + + + + + + + + + MIICkjCCAfugAwIBAgIJAK7VCxPsh8yrMA0GCSqGSIb3DQEBBAUAMDsxCzAJBgNV + BAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxl + Lm9yZzAeFw0wNTA2MjAxNTUwNDFaFw0zMjExMDUxNTUwNDFaMDsxCzAJBgNVBAYT + AlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxlLm9y + ZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2VnUvWYrNhtRUqIxAuFmV8YP + Jhr+OMKJpc/RaEs2C8mk5N5qO+ysClg2cVfkws3O4Lc15AiNdQ0s3ZijYwJK2EEg + 4vmoTl2RrjP1b3PK2h+VbUuYny9enHwDL+Z4bjP/8nmIKlhUSq4DTGXbwdQiWjCd + lQXvDtvHRwX/TaqtHbcCAwEAAaOBnTCBmjAdBgNVHQ4EFgQUlmI7WqzIDJzcfAyU + v2kmk3p9sbAwawYDVR0jBGQwYoAUlmI7WqzIDJzcfAyUv2kmk3p9sbChP6Q9MDsx + CzAJBgNVBAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5l + eGFtcGxlLm9yZ4IJAK7VCxPsh8yrMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE + BQADgYEAsatF5gh1ZBF1QuXxchKp2BKVOsK+23y+FqhuOuVi/PTMf+Li84Ih25Al + Jyy3OKc0oprM6tCJaiSooy32KTW6a1xhPm2MwuXzD33SPoKItue/ndp8Bhx/PO9U + w14fpgtAk2x8xD7cpHsZ073JHxEcjEetD8PTtrFdNu6GwIrv6Sk= + + + + + + + + + + + + urn:mace:shibboleth:1.0:nameIdentifier + urn:oasis:names:tc:SAML:2.0:nameid-format:transient + + + + + + + + + + + + example.org + + + + + + + + MIICkjCCAfugAwIBAgIJAK7VCxPsh8yrMA0GCSqGSIb3DQEBBAUAMDsxCzAJBgNV + BAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxl + Lm9yZzAeFw0wNTA2MjAxNTUwNDFaFw0zMjExMDUxNTUwNDFaMDsxCzAJBgNVBAYT + AlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxlLm9y + ZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2VnUvWYrNhtRUqIxAuFmV8YP + Jhr+OMKJpc/RaEs2C8mk5N5qO+ysClg2cVfkws3O4Lc15AiNdQ0s3ZijYwJK2EEg + 4vmoTl2RrjP1b3PK2h+VbUuYny9enHwDL+Z4bjP/8nmIKlhUSq4DTGXbwdQiWjCd + lQXvDtvHRwX/TaqtHbcCAwEAAaOBnTCBmjAdBgNVHQ4EFgQUlmI7WqzIDJzcfAyU + v2kmk3p9sbAwawYDVR0jBGQwYoAUlmI7WqzIDJzcfAyUv2kmk3p9sbChP6Q9MDsx + CzAJBgNVBAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5l + eGFtcGxlLm9yZ4IJAK7VCxPsh8yrMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE + BQADgYEAsatF5gh1ZBF1QuXxchKp2BKVOsK+23y+FqhuOuVi/PTMf+Li84Ih25Al + Jyy3OKc0oprM6tCJaiSooy32KTW6a1xhPm2MwuXzD33SPoKItue/ndp8Bhx/PO9U + w14fpgtAk2x8xD7cpHsZ073JHxEcjEetD8PTtrFdNu6GwIrv6Sk= + + + + + + + + + + MIICkjCCAfugAwIBAgIJAK7VCxPsh8yrMA0GCSqGSIb3DQEBBAUAMDsxCzAJBgNV + BAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxl + Lm9yZzAeFw0wNTA2MjAxNTUwNDFaFw0zMjExMDUxNTUwNDFaMDsxCzAJBgNVBAYT + AlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5leGFtcGxlLm9y + ZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2VnUvWYrNhtRUqIxAuFmV8YP + Jhr+OMKJpc/RaEs2C8mk5N5qO+ysClg2cVfkws3O4Lc15AiNdQ0s3ZijYwJK2EEg + 4vmoTl2RrjP1b3PK2h+VbUuYny9enHwDL+Z4bjP/8nmIKlhUSq4DTGXbwdQiWjCd + lQXvDtvHRwX/TaqtHbcCAwEAAaOBnTCBmjAdBgNVHQ4EFgQUlmI7WqzIDJzcfAyU + v2kmk3p9sbAwawYDVR0jBGQwYoAUlmI7WqzIDJzcfAyUv2kmk3p9sbChP6Q9MDsx + CzAJBgNVBAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxGDAWBgNVBAMTD2lkcC5l + eGFtcGxlLm9yZ4IJAK7VCxPsh8yrMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE + BQADgYEAsatF5gh1ZBF1QuXxchKp2BKVOsK+23y+FqhuOuVi/PTMf+Li84Ih25Al + Jyy3OKc0oprM6tCJaiSooy32KTW6a1xhPm2MwuXzD33SPoKItue/ndp8Bhx/PO9U + w14fpgtAk2x8xD7cpHsZ073JHxEcjEetD8PTtrFdNu6GwIrv6Sk= + + + + + + + + + + urn:mace:shibboleth:1.0:nameIdentifier + urn:oasis:names:tc:SAML:2.0:nameid-format:transient + + + + + + Example Identity Provider + Identities 'R' Us + http://idp.example.org/ + + + Technical Support + support@idp.example.org + + + diff --git a/configs/globalLogout.html b/configs/globalLogout.html new file mode 100644 index 0000000..bbdf64e --- /dev/null +++ b/configs/globalLogout.html @@ -0,0 +1,40 @@ + + + + + + + + Global Logout + + + + +Logo +

Global Logout

+ +

Status of Global Logout:

+ + +

Error from your identity provider:

+
+ Status:
+ + Sub-Status:
+
+ + Message:
+
+
+
+ +

If the message above indicates success, you have been logged out of all +the applications and systems that support the logout mechanism.

+ +

It is still strongly advised that you close your browser to complete the +logout process.

+ + + diff --git a/configs/keygen.bat b/configs/keygen.bat new file mode 100644 index 0000000..1af0518 --- /dev/null +++ b/configs/keygen.bat @@ -0,0 +1,98 @@ +@echo off +setlocal + +set DAYS= +set YEARS= +set FQDN= +set ENTITYID= +set TEMP_DOMAIN_NAME= +set PARAM= + +set PREFIX=%~dp0 + +:opt_start +set PARAM=%1 +if not defined PARAM goto opt_end +if %1==-h goto opt_fqdn +if %1==-e goto opt_entityid +if %1==-y goto opt_years +if %1==-f goto opt_force +goto usage +:opt_end + +if exist "%PREFIX%sp-key.pem" goto protect +if exist "%PREFIX%sp-cert.pem" goto protect + +if not defined YEARS set YEARS=10 +set /a DAYS=%YEARS%*365 + +if not defined FQDN goto guess_fqdn + +:generate +set PATH=%PREFIX%..\..\lib;%PREFIX%..\..\bin +set CNF="%PREFIX%sp-cert.cnf" +echo # OpenSSL configuration file for creating sp-cert.pem >%CNF% +echo [req] >>%CNF% +echo prompt=no >>%CNF% +echo default_bits=2048 >>%CNF% +echo encrypt_key=no >>%CNF% +echo default_md=sha1 >>%CNF% +echo distinguished_name=dn >>%CNF% +echo # PrintableStrings only >>%CNF% +echo string_mask=MASK:0002 >>%CNF% +echo x509_extensions=ext >>%CNF% +echo [dn] >>%CNF% +echo CN=%FQDN% >>%CNF% +echo [ext] >>%CNF% +if defined ENTITYID (echo subjectAltName=DNS:%FQDN%,URI:%ENTITYID% >>%CNF%) else (echo subjectAltName=DNS:%FQDN% >>%CNF%) +echo subjectKeyIdentifier=hash >>%CNF% +%PREFIX%..\..\bin\openssl.exe req -config %PREFIX%sp-cert.cnf -new -x509 -days %DAYS% -keyout %PREFIX%sp-key.pem -out %PREFIX%sp-cert.pem +del %CNF% +exit /b + +:protect +echo The files sp-key.pem and/or sp-cert.pem already exist! +echo Use -f option to force recreation of keypair. +exit /b + +:opt_force +if exist "%PREFIX%sp-key.pem" del "%PREFIX%sp-key.pem" +if exist "%PREFIX%sp-cert.pem" del "%PREFIX%sp-cert.pem" +shift +goto opt_start + +:opt_fqdn +set FQDN=%2 +shift +shift +goto opt_start + +:opt_entityid +set ENTITYID=%2 +shift +shift +goto opt_start + +:opt_years +set DAYS=%2 +shift +shift +goto opt_start + +:usage +echo usage: keygen [-h hostname for cert] [-y years to issue cert] [-e entityID to embed in cert] +exit /b + +:guess_fqdn +for /F "tokens=2 delims=:" %%i in ('"ipconfig /all | findstr /c:"Primary DNS Suffix" /c:"Primary Dns Suffix""') do set TEMP_DOMAIN_NAME=%%i +if defined TEMP_DOMAIN_NAME set FQDN=%TEMP_DOMAIN_NAME: =% +set TEMP_DOMAIN_NAME= +if defined USERDNSDOMAIN set FQDN=%USERDNSDOMAIN% + +for /F %%i in ('hostname') do set HOST=%%i +if defined FQDN (set FQDN=%HOST%.%FQDN%) else (set FQDN=%HOST%) + +echo >%FQDN% +for /F %%i in ('dir /b/l %FQDN%') do set FQDN=%%i +del %FQDN% +goto generate diff --git a/configs/keygen.sh b/configs/keygen.sh new file mode 100755 index 0000000..aa47b68 --- /dev/null +++ b/configs/keygen.sh @@ -0,0 +1,69 @@ +#! /bin/sh + +while getopts h:e:y:bf c + do + case $c in + b) BATCH=1;; + f) FORCE=1;; + h) FQDN=$OPTARG;; + e) ENTITYID=$OPTARG;; + y) YEARS=$OPTARG;; + \?) echo keygen [-h hostname for cert] [-y years to issue cert] [-e entityID to embed in cert] + exit 1;; + esac + done + +if [ -n "$FORCE" ] ; then + rm sp-key.pem sp-cert.pem +fi + +if [ -s sp-key.pem -o -s sp-cert.pem ] ; then + if [ -z "$BATCH" ] ; then + echo The files sp-key.pem and/or sp-cert.pem already exist! + echo Use -f option to force recreation of keypair. + exit 2 + fi + exit 0 +fi + +if [ -z "$FQDN" ] ; then + FQDN=`hostname` +fi + +if [ -z "$YEARS" ] ; then + YEARS=10 +fi + +DAYS=`expr $YEARS \* 365` + +if [ -z "$ENTITYID" ] ; then + ALTNAME=DNS:$FQDN +else + ALTNAME=DNS:$FQDN,URI:$ENTITYID +fi + +cat >sp-cert.cnf < /dev/null +fi + +rm sp-cert.cnf diff --git a/configs/localLogout.html b/configs/localLogout.html new file mode 100644 index 0000000..1bcb1d1 --- /dev/null +++ b/configs/localLogout.html @@ -0,0 +1,24 @@ + + + + + + + + Local Logout + + + +Logo +

Local Logout

+ +Status of Local Logout: + +

+ +You MUST close your browser to complete the logout process. + + + diff --git a/configs/metadataError.html b/configs/metadataError.html new file mode 100644 index 0000000..d0e667a --- /dev/null +++ b/configs/metadataError.html @@ -0,0 +1,33 @@ + + + + + + + + Unknown Identity Provider + + + + +Logo +

Unknown or Unusable Identity Provider

+ +

The identity provider supplying your login credentials is not authorized +for use with this service or does not support the necessary capabilities.

+ +

To report this problem, please contact the site administrator at +. +

+ +

Please include the following error message in any email:

+

Identity provider lookup failed at ()

+ +

EntityID:

+
+

:

+ + + diff --git a/configs/native.logger.in b/configs/native.logger.in new file mode 100644 index 0000000..78ff4ff --- /dev/null +++ b/configs/native.logger.in @@ -0,0 +1,35 @@ +# set overall behavior +log4j.rootCategory=INFO, native_log + +# fairly verbose for DEBUG, so generally leave at INFO +log4j.category.XMLTooling.XMLObject=INFO +log4j.category.XMLTooling.KeyInfoResolver=INFO +log4j.category.Shibboleth.PropertySet=INFO + +# raise for low-level tracing of SOAP client HTTP/SSL behavior +log4j.category.XMLTooling.libcurl=INFO + +# useful categories to tune independently: +# +# tracing of SAML messages and security policies +#log4j.category.OpenSAML.MessageDecoder=DEBUG +#log4j.category.OpenSAML.MessageEncoder=DEBUG +#log4j.category.OpenSAML.SecurityPolicyRule=DEBUG +# interprocess message remoting +#log4j.category.Shibboleth.Listener=DEBUG +# mapping of requests to applicationId +#log4j.category.Shibboleth.RequestMapper=DEBUG +# high level session cache operations +#log4j.category.Shibboleth.SessionCache=DEBUG +# persistent storage and caching +#log4j.category.XMLTooling.StorageService=DEBUG + +# define the appender + +log4j.appender.native_log=org.apache.log4j.RollingFileAppender +log4j.appender.native_log.fileName=@-SHIRELOGDIR-@/native.log +log4j.appender.native_log.maxFileSize=1000000 +log4j.appender.native_log.maxBackupIndex=10 +#log4j.appender.native_log.layout=org.apache.log4j.BasicLayout +log4j.appender.native_log.layout=org.apache.log4j.PatternLayout +log4j.appender.native_log.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %p %c %x: %m%n diff --git a/configs/sessionError.html b/configs/sessionError.html new file mode 100644 index 0000000..2273174 --- /dev/null +++ b/configs/sessionError.html @@ -0,0 +1,43 @@ + + + + + + + + <shibmlp errorType/> + + + + +Logo +

+ +

The system encountered an error at

+ +

To report this problem, please contact the site administrator at +. +

+ +

Please include the following message in any email:

+

at ()

+ +

+ + +

Error from identity provider:

+
+ Status:
+ + Sub-Status:
+
+ + Message:
+
+
+
+ + + diff --git a/configs/shibboleth2.xml b/configs/shibboleth2.xml new file mode 100644 index 0000000..fa230c5 --- /dev/null +++ b/configs/shibboleth2.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/shibd-debian.in b/configs/shibd-debian.in new file mode 100644 index 0000000..99ff4d1 --- /dev/null +++ b/configs/shibd-debian.in @@ -0,0 +1,84 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: shibd +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: Shibboleth 2 Service Provider Daemon +# Description: Starts the separate daemon used by the Shibboleth +# Apache module to manage sessions and to retrieve +# attributes from Shibboleth Identity Providers. +### END INIT INFO +# +# Written by Quanah Gibson-Mount +# Modified by Lukas Haemmerle for Shibboleth 2 +# Based on the dh-make template written by: +# +# Written by Miquel van Smoorenburg . +# Modified for Debian +# by Ian Murdock . + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC="Shibboleth 2 daemon" +NAME=shibd +SHIB_HOME=@-PREFIX-@ +SHIBSP_CONFIG=@-PKGSYSCONFDIR-@/shibboleth2.xml +LD_LIBRARY_PATH=@-PREFIX-@/lib +DAEMON=@-PREFIX-@/sbin/$NAME +SCRIPTNAME=/etc/init.d/$NAME +PIDFILE=@-PKGRUNDIR-@/$NAME.pid +DAEMON_OPTS="" + +# Force removal of socket +DAEMON_OPTS="$DAEMON_OPTS -f" + +# Use defined configuration file +DAEMON_OPTS="$DAEMON_OPTS -c $SHIBSP_CONFIG" + +# Specify pid file to use +DAEMON_OPTS="$DAEMON_OPTS -p $PIDFILE" + +# Exit if the package is not installed. +[ -x "$DAEMON" ] || exit 0 + +# Read configuration if it is present. +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Get the setting of VERBOSE and other rcS variables. +[ -f /etc/default/rcS ] && . /etc/default/rcS + +case "$1" in +start) + # Don't start shibd if NO_START is set. + if [ "$NO_START" = 1 ] ; then + echo "Not starting $DESC (see /etc/default/$NAME)" + exit 0 + fi + echo -n "Starting $DESC: " + start-stop-daemon --background --start --quiet \ + --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; +stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + echo "$NAME." + ;; +restart|force-reload) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + sleep 1 + start-stop-daemon --background --start --quiet \ + --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; +*) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/configs/shibd-osx.plist.in b/configs/shibd-osx.plist.in new file mode 100644 index 0000000..26c90b1 --- /dev/null +++ b/configs/shibd-osx.plist.in @@ -0,0 +1,20 @@ + + + + + Label edu.internet2.shibboleth.shibd + ServiceDescription Shibboleth 2.0 Service Provider daemon + + ProgramArguments + + @-PREFIX-@/sbin/shibd + -f + -p + @-PKGRUNDIR-@/shibd.pid + + + RunAtLoad + OnDemand + StandardErrorPath /dev/null + + diff --git a/configs/shibd-redhat.in b/configs/shibd-redhat.in new file mode 100644 index 0000000..496f631 --- /dev/null +++ b/configs/shibd-redhat.in @@ -0,0 +1,84 @@ +#!/bin/bash +# +# Startup script for the Shibboleth Service Provider Daemon +# +# chkconfig: - 98 02 +# description: Shibboleth 2 Service Provider Daemon +# processname: shibd +# pidfile: @-PKGRUNDIR-@/shibd.pid +# config: @-PKGSYSCONFDIR-@/shibboleth2.xml + +# Source function library. +. /etc/rc.d/init.d/functions +shibd="@-PREFIX-@/sbin/shibd" +SHIBD_USER=root +pidfile=@-PKGRUNDIR-@/shibd.pid +prog=shibd +RETVAL=0 + +start() { + echo -n $"Starting $prog: " + if [ -f /var/lock/subsys/shibd ] ; then + if [ -f $pidfile ]; then + read kpid < $pidfile + if checkpid $kpid 2>&1; then + echo "process already running" + return -1 + else + echo "lock file found but no process running for pid $kpid, continuing" + fi + fi + fi + + export SHIBD_PID=$pidfile + touch $pidfile + chown $SHIBD_USER:$SHIBD_USER $pidfile + if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then + /sbin/restorecon $pidfile + fi + # daemon function just hangs, so I'm using su directly + su - $SHIBD_USER -c "$shibd -p $pidfile -f &" + + RETVAL=$? + echo + [ $RETVAL = 0 ] && touch /var/lock/subsys/shibd + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + if [ -f $pidfile ]; then + read kpid < $pidfile + kill $kpid + else + killproc shibd + fi + + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f /var/lock/subsys/shibd $pidfile +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $shibd + RETVAL=$? + ;; + restart) + stop + sleep 5 + start + ;; + *) + echo $"Usage: $prog {start|stop|restart}" + exit 1 +esac + +exit $RETVAL diff --git a/configs/shibd.logger.in b/configs/shibd.logger.in new file mode 100644 index 0000000..4723e73 --- /dev/null +++ b/configs/shibd.logger.in @@ -0,0 +1,47 @@ +# set overall behavior +log4j.rootCategory=INFO, shibd_log + +# fairly verbose for DEBUG, so generally leave at INFO +log4j.category.XMLTooling.XMLObject=INFO +log4j.category.XMLTooling.KeyInfoResolver=INFO +log4j.category.Shibboleth.PropertySet=INFO + +# raise for low-level tracing of SOAP client HTTP/SSL behavior +log4j.category.XMLTooling.libcurl=INFO + +# useful categories to tune independently: +# +# tracing of SAML messages and security policies +#log4j.category.OpenSAML.MessageDecoder=DEBUG +#log4j.category.OpenSAML.MessageEncoder=DEBUG +#log4j.category.OpenSAML.SecurityPolicyRule=DEBUG +# interprocess message remoting +#log4j.category.Shibboleth.Listener=DEBUG +# mapping of requests to applicationId +#log4j.category.Shibboleth.RequestMapper=DEBUG +# high level session cache operations +#log4j.category.Shibboleth.SessionCache=DEBUG +# persistent storage and caching +#log4j.category.XMLTooling.StorageService=DEBUG + +# the tran log blocks the "default" appender(s) at runtime +# Level should be left at INFO for this category +log4j.category.Shibboleth-TRANSACTION=INFO, tran_log +log4j.additivity.Shibboleth-TRANSACTION=false + +# define the appenders + +log4j.appender.shibd_log=org.apache.log4j.RollingFileAppender +log4j.appender.shibd_log.fileName=@-PKGLOGDIR-@/shibd.log +log4j.appender.shibd_log.maxFileSize=1000000 +log4j.appender.shibd_log.maxBackupIndex=10 +#log4j.appender.shibd_log.layout=org.apache.log4j.BasicLayout +log4j.appender.shibd_log.layout=org.apache.log4j.PatternLayout +log4j.appender.shibd_log.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %p %c %x: %m%n + +log4j.appender.tran_log=org.apache.log4j.RollingFileAppender +log4j.appender.tran_log.fileName=@-PKGLOGDIR-@/transaction.log +log4j.appender.tran_log.maxFileSize=1000000 +log4j.appender.tran_log.maxBackupIndex=20 +log4j.appender.tran_log.layout=org.apache.log4j.PatternLayout +log4j.appender.tran_log.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %p %c %x: %m%n diff --git a/configs/sslError.html b/configs/sslError.html new file mode 100644 index 0000000..2d25f3c --- /dev/null +++ b/configs/sslError.html @@ -0,0 +1,28 @@ + + + + + + + + POST Failed + + + + +Logo +

POST Failed

+ + +You have attemped to submit information without the protection +of SSL to this site.
+ +For the protection of your submission and the integrity of the site, +this is not permitted. Please try accessing the server with a +URL starting with https:// and report this problem +to + + + diff --git a/configs/syslog.logger b/configs/syslog.logger new file mode 100644 index 0000000..3d14313 --- /dev/null +++ b/configs/syslog.logger @@ -0,0 +1,33 @@ +log4j.rootCategory=INFO, syslog + +# fairly verbose for DEBUG, so generally leave at INFO +log4j.category.XMLTooling.XMLObject=INFO +log4j.category.XMLTooling.KeyInfoResolver=INFO +log4j.category.Shibboleth.PropertySet=INFO + +# raise for low-level tracing of SOAP client HTTP/SSL behavior +log4j.category.XMLTooling.libcurl=INFO + +# useful categories to tune independently: +# +# tracing of SAML messages and security policies +#log4j.category.OpenSAML.MessageDecoder=DEBUG +#log4j.category.OpenSAML.MessageEncoder=DEBUG +#log4j.category.OpenSAML.SecurityPolicyRule=DEBUG +# interprocess message remoting +#log4j.category.Shibboleth.Listener=DEBUG +# mapping of requests to applicationId +#log4j.category.Shibboleth.RequestMapper=DEBUG +# high level session cache operations +#log4j.category.Shibboleth.SessionCache=DEBUG +# persistent storage and caching +#log4j.category.XMLTooling.StorageService=DEBUG + +# define the appender + +log4j.appender.syslog=org.apache.log4j.SyslogAppender +log4j.appender.syslog.syslogName=shibboleth +log4j.appender.syslog.syslogHost=localhost +#log4j.appender.syslog.layout=org.apache.log4j.BasicLayout +log4j.appender.syslog.layout=org.apache.log4j.PatternLayout +log4j.appender.syslog.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %p %c %x: %m%n diff --git a/configs/upgrade.xsl b/configs/upgrade.xsl new file mode 100644 index 0000000..be86033 --- /dev/null +++ b/configs/upgrade.xsl @@ -0,0 +1,482 @@ + + + + + + + + + + + + + + + + + + + + Generated by upgrade utility: check carefully before deploying. + + + + + + + + + + + This set of components stores sessions and other persistent data in daemon memory. + + + + + + + + + + + + This set of components stores sessions and other persistent data in an ODBC database. + + + + + <StorageService type="ODBC" id="db" cleanupInterval="900"> + <ConnectionString>DRIVER=drivername;SERVER=dbserver;UID=shibboleth;PWD=password;DATABASE=shibboleth;APP=Shibboleth</ConnectionString> + </StorageService> + <SessionCache type="StorageService" StorageService="db" cacheTimeout="3600" inprocTimeout="900" cleanupInterval="900"/> + <ReplayCache StorageService="db"/> + <ArtifactMap StorageService="db" artifactTTL="180"/> + + + + + + + + Each policy defines a set of rules to use to secure messages. + + + + + + The predefined policy enforces replay/freshness and permits signing and client TLS. + + + + + + + + + + + + + + + + + + + + + + + + + + + <Extensions> + <Library path="odbc-store.so" fatal="true"/> + </Extensions> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Chain the two built-in trust engines together. + + + + + + + + + + + + Map to extract attributes from SAML assertions. + + + + + + Use a SAML query if no attributes are supplied during SSO. + + + + + + Default filtering policy for recognized attributes, lets other data pass. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SessionInitiators handle session requests and relay them to a Discovery page, + or to an IdP if possible. Automatic session setup will use the default or first + element (or requireSessionWith can specify a specific one to use). + + + + + + + + + md:AssertionConsumerService locations handle specific SSO protocol bindings, + such as SAML 2.0 POST or SAML 1.1 Artifact. The isDefault and index attributes + are used when sessions are initiated to determine how to tell the IdP where and + how to return the response. + + + + + + + + + + + + + + + + + + + + + + + /Logout + + + + + LogoutInitiators enable SP-initiated local or global/single logout of sessions. + + + + + + + + + + + + + md:SingleLogoutService locations handle single logout (SLO) protocol messages. + + + + + + + + + + + + + md:ManageNameIDService locations handle NameID management (NIM) protocol messages. + + + + + + + + + + + + + + md:ArtifactResolutionService locations resolve artifacts issued when using the + SAML 2.0 HTTP-Artifact binding on outgoing messages, generally uses SOAP. + + + + + + + + Extension service that generates "approximate" metadata based on SP configuration. + + + + + + + Status reporting service. + + + + + + + Session diagnostic service. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localLogout.html + globalLogout.html + + + + + + + + + + + + + + + + + + + + + + + + 12 + + + + + + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/xsltproc.js b/configs/xsltproc.js new file mode 100644 index 0000000..b444f6d --- /dev/null +++ b/configs/xsltproc.js @@ -0,0 +1,45 @@ +var oArgs = WScript.Arguments; + +if (oArgs.length < 2) { + WScript.Echo("usage: cscript xslt.js xml xsl"); + WScript.Quit(); +} + +xslFile = oArgs(0); +xmlFile = oArgs(1); + +var xml = new ActiveXObject("MSXML2.DOMDocument.5.0"); +var xsl = new ActiveXObject("MSXML2.FreeThreadedDOMDocument.5.0"); +var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate.5.0"); + +xml.validateOnParse = false; +xml.async = false; +xml.load(xmlFile); + +if (xml.parseError.errorCode != 0) + WScript.Echo("XML Parse Error: " + xml.parseError.reason); + +xsl.async = false; +xsl.load(xslFile); + +if (xsl.parseError.errorCode != 0) + WScript.Echo("XSL Parse Error: " + xsl.parseError.reason); + +xslTemplate.stylesheet = xsl; +var xslProcessor = xslTemplate.createProcessor(); +xslProcessor.input = xml; + +try { + var writer = new ActiveXObject("MSXML2.MXXMLWriter.5.0"); + xslProcessor.output = writer; + + for (i=2; i. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='shibboleth' +PACKAGE_TARNAME='shibboleth' +PACKAGE_VERSION='2.0' +PACKAGE_STRING='shibboleth 2.0' +PACKAGE_BUGREPORT='shibboleth-users@internet2.edu' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DX_PROJECT DX_CONFIG DX_DOCDIR DX_ENV DX_FLAG_doc DX_DOXYGEN ac_pt_DX_DOXYGEN DX_FLAG_[]DX_CURRENT_FEATURE DX_PERL ac_pt_DX_PERL DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_doc_TRUE DX_COND_doc_FALSE DX_FLAG_dot DX_FLAG_[]DX_CURRENT_FEATURE DX_DOT ac_pt_DX_DOT DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_dot_TRUE DX_COND_dot_FALSE DX_FLAG_man DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_man_TRUE DX_COND_man_FALSE DX_FLAG_rtf DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_rtf_TRUE DX_COND_rtf_FALSE DX_FLAG_xml DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_xml_TRUE DX_COND_xml_FALSE DX_FLAG_chm DX_FLAG_[]DX_CURRENT_FEATURE DX_HHC ac_pt_DX_HHC DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_chm_TRUE DX_COND_chm_FALSE DX_FLAG_chi DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_chi_TRUE DX_COND_chi_FALSE DX_FLAG_html DX_FLAG_[]DX_CURRENT_FEATURE DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_html_TRUE DX_COND_html_FALSE DX_FLAG_ps DX_FLAG_[]DX_CURRENT_FEATURE DX_LATEX ac_pt_DX_LATEX DX_FLAG_[]DX_CURRENT_FEATURE DX_MAKEINDEX ac_pt_DX_MAKEINDEX DX_FLAG_[]DX_CURRENT_FEATURE DX_DVIPS ac_pt_DX_DVIPS DX_FLAG_[]DX_CURRENT_FEATURE DX_EGREP ac_pt_DX_EGREP DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_ps_TRUE DX_COND_ps_FALSE DX_FLAG_pdf DX_FLAG_[]DX_CURRENT_FEATURE DX_PDFLATEX ac_pt_DX_PDFLATEX DX_FLAG_[]DX_CURRENT_FEATURE DX_FLAG_[]DX_CURRENT_FEATURE DX_FLAG_[]DX_CURRENT_FEATURE DX_COND_pdf_TRUE DX_COND_pdf_FALSE DX_COND_latex_TRUE DX_COND_latex_FALSE DOXYGEN_PAPER_SIZE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS PKG_CONFIG LOG4SHIB_CONFIG LOG4CPP_CONFIG XMLTOOLINGXMLDIR OPENSAMLXMLDIR LITE_LIBS XMLSEC_LIBS NSAPI_INCLUDE BUILD_NSAPI_TRUE BUILD_NSAPI_FALSE FASTCGI_INCLUDE FASTCGI_LDFLAGS FASTCGI_LIBS BUILD_FASTCGI_TRUE BUILD_FASTCGI_FALSE xs APXS APXS_CFLAGS APXS_INCLUDE APXS2 APR_CONFIG APXS2_CFLAGS APXS2_INCLUDE APXS22 APR1_CONFIG APXS22_CFLAGS APXS22_INCLUDE BUILD_AP13_TRUE BUILD_AP13_FALSE BUILD_AP20_TRUE BUILD_AP20_FALSE BUILD_AP22_TRUE BUILD_AP22_FALSE ODBC_CONFIG ODBC_CFLAGS ODBC_LIBS WANT_SUBDIRS LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_DOXYGEN_PAPER_SIZE_set=${DOXYGEN_PAPER_SIZE+set} +ac_env_DOXYGEN_PAPER_SIZE_value=$DOXYGEN_PAPER_SIZE +ac_cv_env_DOXYGEN_PAPER_SIZE_set=${DOXYGEN_PAPER_SIZE+set} +ac_cv_env_DOXYGEN_PAPER_SIZE_value=$DOXYGEN_PAPER_SIZE +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures shibboleth 2.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of shibboleth 2.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-doxygen-doc don't generate any doxygen documentation + --disable-doxygen-dot don't generate graphics for doxygen documentation + --enable-doxygen-man generate doxygen manual pages + --enable-doxygen-rtf generate doxygen RTF documentation + --enable-doxygen-xml generate doxygen XML documentation + --enable-doxygen-chm generate doxygen compressed HTML help documentation + --enable-doxygen-chi generate doxygen seperate compressed HTML help index + file + --disable-doxygen-html don't generate doxygen plain HTML documentation + --enable-doxygen-ps generate doxygen PostScript documentation + --enable-doxygen-pdf generate doxygen PDF documentation + --enable-debug Have GCC compile with symbols (Default = no) + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-static[=PKGS] + build static libraries [default=no] + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-adfs don't build the ADFS module + --enable-apache-13 enable the Apache 1.3 module + --enable-apache-20 enable the Apache 2.0 module + --enable-apache-22 enable the Apache 2.2 module + --disable-odbc disable the ODBC Storage Service + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] + include additional configurations [automatic] + --with-openssl=PATH where openssl is installed + --with-log4shib=PATH where log4shib-config is installed + --with-log4cpp=PATH where log4cpp-config is installed + --with-xerces=PATH where xerces-c is installed + --with-xmltooling=PATH where xmltooling-c is installed + --with-xmlsec=PATH where xmlsec is installed + --with-saml=PATH where saml is installed + --with-nsapi=DIR Build NSAPI module for Netscape/iPlanet/SunONE + --with-fastcgi=DIR Build FastCGI support + --with-apxs=FILE Specifies where to find the Apache 1.3 apxs script. + --with-apxs2=FILE Specifies where to find the Apache 2.0 apxs script. + --with-apr=PATH where apr-config is installed + --with-apxs22=FILE Specifies where to find the Apache 2.2 apxs script. + --with-apr1=PATH where apr-1-config is installed + --with-odbc=PATH directory where odbc is installed + +Some influential environment variables: + DOXYGEN_PAPER_SIZE + a4wide (default), a4, letter, legal or executive + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +shibboleth configure 2.0 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by shibboleth $as_me 2.0, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h" + +am__api_version="1.9" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=shibboleth + VERSION=2.0 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# This file is part of Autoconf. -*- Autoconf -*- + +# Copyright (C) 2004 Oren Ben-Kiki +# This file is distributed under the same terms as the Autoconf macro files. + +# Generate automatic documentation using Doxygen. Works in concert with the +# aminclude.m4 file and a compatible doxygen configuration file. Defines the +# following public macros: +# +# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature. +# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics, +# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI' +# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF', +# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment +# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide' +# paper size. +# +# By default, HTML, PDF and PS documentation is generated as this seems to be +# the most popular and portable combination. MAN pages created by Doxygen are +# usually problematic, though by picking an appropriate subset and doing some +# massaging they might be better than nothing. CHM and RTF are specific for MS +# (note that you can't generate both HTML and CHM at the same time). The XML is +# rather useless unless you apply specialized post-processing to it. +# +# The macro mainly controls the default state of the feature. The use can +# override the default by specifying --enable or --disable. The macros ensure +# that contradictory flags are not given (e.g., --enable-doxygen-html and +# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.) +# Finally, each feature will be automatically disabled (with a warning) if the +# required programs are missing. +# +# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with +# the following parameters: a one-word name for the project for use as a +# filename base etc., an optional configuration file name (the default is +# 'Doxyfile', the same as Doxygen's default), and an optional output directory +# name (the default is 'doxygen-doc'). + +## ----------## +## Defaults. ## +## ----------## + +DX_ENV="" + + + + + + + + + + + +## --------------- ## +## Private macros. ## +## --------------- ## + +# DX_ENV_APPEND(VARIABLE, VALUE) +# ------------------------------ +# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen. + + +# DX_DIRNAME_EXPR +# --------------- +# Expand into a shell expression prints the directory part of a path. + + +# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) +# ------------------------------------- +# Expands according to the M4 (static) status of the feature. + + +# DX_REQUIRE_PROG(VARIABLE, PROGRAM) +# ---------------------------------- +# Require the specified program to be found for the DX_CURRENT_FEATURE to work. + + +# DX_TEST_FEATURE(FEATURE) +# ------------------------ +# Expand to a shell expression testing whether the feature is active. + + +# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) +# ------------------------------------------------- +# Verify that a required features has the right state before trying to turn on +# the DX_CURRENT_FEATURE. + + +# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) +# ---------------------------------------------------------- +# Turn off the DX_CURRENT_FEATURE if the required feature is off. + + +# DX_FEATURE_ARG(FEATURE, DESCRIPTION, +# CHECK_DEPEND, CLEAR_DEPEND, +# REQUIRE, DO-IF-ON, DO-IF-OFF) +# -------------------------------------------- +# Parse the command-line option controlling a feature. CHECK_DEPEND is called +# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), +# otherwise CLEAR_DEPEND is called to turn off the default state if a required +# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional +# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and +# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. + + +## -------------- ## +## Public macros. ## +## -------------- ## + +# DX_XXX_FEATURE(DEFAULT_STATE) +# ----------------------------- + + + + + + + + + + + +# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR]) +# --------------------------------------------------------- +# PROJECT also serves as the base name for the documentation files. +# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc". + + +##### http://autoconf-archive.cryp.to/acx_pthread.html +# +# SYNOPSIS +# +# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. +# It sets the PTHREAD_LIBS output variable to the threads library and +# linker flags, and the PTHREAD_CFLAGS output variable to any special +# C compiler flags that are needed. (The user can also force certain +# compiler flags/libs to be tested by setting these environment +# variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). +# (This is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these +# flags, but also link it with them as well. e.g. you should link +# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS +# $LIBS +# +# If you are only building threads programs, you may wish to use +# these variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute +# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads +# library is found, and ACTION-IF-NOT-FOUND is a list of commands to +# run it if it is not found. If ACTION-IF-FOUND is not specified, the +# default action will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or +# if you have any other suggestions or comments. This macro was based +# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) +# (with help from M. Frigo), as well as ac_pthread and hb_pthread +# macros posted by Alejandro Forero Cuervo to the autoconf macro +# repository. We are also grateful for the helpful feedback of +# numerous users. +# +# LAST MODIFICATION +# +# 2006-05-29 +# +# COPYLEFT +# +# Copyright (c) 2006 Steven G. Johnson +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + + + +# Docygen features + + + + + + + + + + +# Files: +DX_PROJECT=shibboleth + +DX_CONFIG=doxygen.cfg + +DX_DOCDIR=doc/api + + +# Environment variables used inside doxygen.cfg: +DX_ENV="$DX_ENV SRCDIR='$srcdir'" + +DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" + +DX_ENV="$DX_ENV DOCDIR='$DX_DOCDIR'" + +DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" + + +# Doxygen itself: + + + + # Check whether --enable-doxygen-doc or --disable-doxygen-doc was given. +if test "${enable_doxygen_doc+set}" = set; then + enableval="$enable_doxygen_doc" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_doc=1 + + +;; #( +n|N|no|No|NO) + DX_FLAG_doc=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-doc" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-doc" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_doc=1 + + + +fi; +if test "$DX_FLAG_doc" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. +set dummy ${ac_tool_prefix}doxygen; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_DOXYGEN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN + +if test -n "$DX_DOXYGEN"; then + echo "$as_me:$LINENO: result: $DX_DOXYGEN" >&5 +echo "${ECHO_T}$DX_DOXYGEN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_DOXYGEN"; then + ac_pt_DX_DOXYGEN=$DX_DOXYGEN + # Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_DOXYGEN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN + +if test -n "$ac_pt_DX_DOXYGEN"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_DOXYGEN" >&5 +echo "${ECHO_T}$ac_pt_DX_DOXYGEN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_DOXYGEN=$ac_pt_DX_DOXYGEN +else + DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" +fi + +if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then + { echo "$as_me:$LINENO: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 +echo "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. +set dummy ${ac_tool_prefix}perl; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PERL="$DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PERL="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_PERL=$ac_cv_path_DX_PERL + +if test -n "$DX_PERL"; then + echo "$as_me:$LINENO: result: $DX_PERL" >&5 +echo "${ECHO_T}$DX_PERL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_PERL"; then + ac_pt_DX_PERL=$DX_PERL + # Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PERL="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL + +if test -n "$ac_pt_DX_PERL"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_PERL" >&5 +echo "${ECHO_T}$ac_pt_DX_PERL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_PERL=$ac_pt_DX_PERL +else + DX_PERL="$ac_cv_path_DX_PERL" +fi + +if test "$DX_FLAG_doc$DX_PERL" = 1; then + { echo "$as_me:$LINENO: WARNING: perl not found - will not generate any doxygen documentation" >&5 +echo "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + : +fi +if test "$DX_FLAG_doc" = 1; then + + +if :; then + DX_COND_doc_TRUE= + DX_COND_doc_FALSE='#' +else + DX_COND_doc_TRUE='#' + DX_COND_doc_FALSE= +fi + + DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" + + : +else + + +if false; then + DX_COND_doc_TRUE= + DX_COND_doc_FALSE='#' +else + DX_COND_doc_TRUE='#' + DX_COND_doc_FALSE= +fi + + + : +fi + + +# Dot for graphics: + + + + # Check whether --enable-doxygen-dot or --disable-doxygen-dot was given. +if test "${enable_doxygen_dot+set}" = set; then + enableval="$enable_doxygen_dot" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_dot=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-dot requires doxygen-dot" >&5 +echo "$as_me: error: doxygen-dot requires doxygen-dot" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_dot=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-dot" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-dot" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_dot=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 + + + +fi; +if test "$DX_FLAG_dot" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. +set dummy ${ac_tool_prefix}dot; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_DOT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOT="$DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_DOT=$ac_cv_path_DX_DOT + +if test -n "$DX_DOT"; then + echo "$as_me:$LINENO: result: $DX_DOT" >&5 +echo "${ECHO_T}$DX_DOT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_DOT"; then + ac_pt_DX_DOT=$DX_DOT + # Extract the first word of "dot", so it can be a program name with args. +set dummy dot; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_DOT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT + +if test -n "$ac_pt_DX_DOT"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_DOT" >&5 +echo "${ECHO_T}$ac_pt_DX_DOT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_DOT=$ac_pt_DX_DOT +else + DX_DOT="$ac_cv_path_DX_DOT" +fi + +if test "$DX_FLAG_dot$DX_DOT" = 1; then + { echo "$as_me:$LINENO: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 +echo "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} + DX_FLAG_dot=0 + +fi + + : +fi +if test "$DX_FLAG_dot" = 1; then + + +if :; then + DX_COND_dot_TRUE= + DX_COND_dot_FALSE='#' +else + DX_COND_dot_TRUE='#' + DX_COND_dot_FALSE= +fi + + DX_ENV="$DX_ENV HAVE_DOT='YES'" + + DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" + + : +else + + +if false; then + DX_COND_dot_TRUE= + DX_COND_dot_FALSE='#' +else + DX_COND_dot_TRUE='#' + DX_COND_dot_FALSE= +fi + + DX_ENV="$DX_ENV HAVE_DOT='NO'" + + : +fi + + +# Man pages generation: + + + + # Check whether --enable-doxygen-man or --disable-doxygen-man was given. +if test "${enable_doxygen_man+set}" = set; then + enableval="$enable_doxygen_man" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_man=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-man requires doxygen-man" >&5 +echo "$as_me: error: doxygen-man requires doxygen-man" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_man=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-man" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-man" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_man=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 + + + +fi; +if test "$DX_FLAG_man" = 1; then + + : +fi +if test "$DX_FLAG_man" = 1; then + + +if :; then + DX_COND_man_TRUE= + DX_COND_man_FALSE='#' +else + DX_COND_man_TRUE='#' + DX_COND_man_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_MAN='YES'" + + : +else + + +if false; then + DX_COND_man_TRUE= + DX_COND_man_FALSE='#' +else + DX_COND_man_TRUE='#' + DX_COND_man_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_MAN='NO'" + + : +fi + + +# RTF file generation: + + + + # Check whether --enable-doxygen-rtf or --disable-doxygen-rtf was given. +if test "${enable_doxygen_rtf+set}" = set; then + enableval="$enable_doxygen_rtf" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_rtf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-rtf requires doxygen-rtf" >&5 +echo "$as_me: error: doxygen-rtf requires doxygen-rtf" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_rtf=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-rtf" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-rtf" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_rtf=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 + + + +fi; +if test "$DX_FLAG_rtf" = 1; then + + : +fi +if test "$DX_FLAG_rtf" = 1; then + + +if :; then + DX_COND_rtf_TRUE= + DX_COND_rtf_FALSE='#' +else + DX_COND_rtf_TRUE='#' + DX_COND_rtf_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_RTF='YES'" + + : +else + + +if false; then + DX_COND_rtf_TRUE= + DX_COND_rtf_FALSE='#' +else + DX_COND_rtf_TRUE='#' + DX_COND_rtf_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_RTF='NO'" + + : +fi + + +# XML file generation: + + + + # Check whether --enable-doxygen-xml or --disable-doxygen-xml was given. +if test "${enable_doxygen_xml+set}" = set; then + enableval="$enable_doxygen_xml" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_xml=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-xml requires doxygen-xml" >&5 +echo "$as_me: error: doxygen-xml requires doxygen-xml" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_xml=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-xml" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-xml" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_xml=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 + + + +fi; +if test "$DX_FLAG_xml" = 1; then + + : +fi +if test "$DX_FLAG_xml" = 1; then + + +if :; then + DX_COND_xml_TRUE= + DX_COND_xml_FALSE='#' +else + DX_COND_xml_TRUE='#' + DX_COND_xml_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_XML='YES'" + + : +else + + +if false; then + DX_COND_xml_TRUE= + DX_COND_xml_FALSE='#' +else + DX_COND_xml_TRUE='#' + DX_COND_xml_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_XML='NO'" + + : +fi + + +# (Compressed) HTML help generation: + + + + # Check whether --enable-doxygen-chm or --disable-doxygen-chm was given. +if test "${enable_doxygen_chm+set}" = set; then + enableval="$enable_doxygen_chm" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chm=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-chm requires doxygen-chm" >&5 +echo "$as_me: error: doxygen-chm requires doxygen-chm" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_chm=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-chm" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-chm" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_chm=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 + + + +fi; +if test "$DX_FLAG_chm" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. +set dummy ${ac_tool_prefix}hhc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_HHC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_HHC="$DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_HHC="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_HHC=$ac_cv_path_DX_HHC + +if test -n "$DX_HHC"; then + echo "$as_me:$LINENO: result: $DX_HHC" >&5 +echo "${ECHO_T}$DX_HHC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_HHC"; then + ac_pt_DX_HHC=$DX_HHC + # Extract the first word of "hhc", so it can be a program name with args. +set dummy hhc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_HHC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_HHC="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC + +if test -n "$ac_pt_DX_HHC"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_HHC" >&5 +echo "${ECHO_T}$ac_pt_DX_HHC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_HHC=$ac_pt_DX_HHC +else + DX_HHC="$ac_cv_path_DX_HHC" +fi + +if test "$DX_FLAG_chm$DX_HHC" = 1; then + { echo "$as_me:$LINENO: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 +echo "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} + DX_FLAG_chm=0 + +fi + + : +fi +if test "$DX_FLAG_chm" = 1; then + + +if :; then + DX_COND_chm_TRUE= + DX_COND_chm_FALSE='#' +else + DX_COND_chm_TRUE='#' + DX_COND_chm_FALSE= +fi + + DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" + + DX_ENV="$DX_ENV GENERATE_HTML='YES'" + + DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" + + : +else + + +if false; then + DX_COND_chm_TRUE= + DX_COND_chm_FALSE='#' +else + DX_COND_chm_TRUE='#' + DX_COND_chm_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" + + : +fi + + +# Seperate CHI file generation. + + + + # Check whether --enable-doxygen-chi or --disable-doxygen-chi was given. +if test "${enable_doxygen_chi+set}" = set; then + enableval="$enable_doxygen_chi" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chi=1 + + +test "$DX_FLAG_chm" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-chi requires doxygen-chi" >&5 +echo "$as_me: error: doxygen-chi requires doxygen-chi" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_chi=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-chi" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-chi" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_chi=0 + + +test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 + + + +fi; +if test "$DX_FLAG_chi" = 1; then + + : +fi +if test "$DX_FLAG_chi" = 1; then + + +if :; then + DX_COND_chi_TRUE= + DX_COND_chi_FALSE='#' +else + DX_COND_chi_TRUE='#' + DX_COND_chi_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_CHI='YES'" + + : +else + + +if false; then + DX_COND_chi_TRUE= + DX_COND_chi_FALSE='#' +else + DX_COND_chi_TRUE='#' + DX_COND_chi_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_CHI='NO'" + + : +fi + + +# Plain HTML pages generation: + + + + # Check whether --enable-doxygen-html or --disable-doxygen-html was given. +if test "${enable_doxygen_html+set}" = set; then + enableval="$enable_doxygen_html" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-html requires doxygen-html" >&5 +echo "$as_me: error: doxygen-html requires doxygen-html" >&2;} + { (exit 1); exit 1; }; } + +test "$DX_FLAG_chm" = "0" \ +|| { { echo "$as_me:$LINENO: error: doxygen-html contradicts doxygen-html" >&5 +echo "$as_me: error: doxygen-html contradicts doxygen-html" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_html=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-html" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-html" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 + + +test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 + + + +fi; +if test "$DX_FLAG_html" = 1; then + + : +fi +if test "$DX_FLAG_html" = 1; then + + +if :; then + DX_COND_html_TRUE= + DX_COND_html_FALSE='#' +else + DX_COND_html_TRUE='#' + DX_COND_html_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_HTML='YES'" + + : +else + + +if false; then + DX_COND_html_TRUE= + DX_COND_html_FALSE='#' +else + DX_COND_html_TRUE='#' + DX_COND_html_FALSE= +fi + + test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" + + : +fi + + +# PostScript file generation: + + + + # Check whether --enable-doxygen-ps or --disable-doxygen-ps was given. +if test "${enable_doxygen_ps+set}" = set; then + enableval="$enable_doxygen_ps" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_ps=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-ps requires doxygen-ps" >&5 +echo "$as_me: error: doxygen-ps requires doxygen-ps" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_ps=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-ps" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-ps" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_ps=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 + + + +fi; +if test "$DX_FLAG_ps" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. +set dummy ${ac_tool_prefix}latex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_LATEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_LATEX="$DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_LATEX=$ac_cv_path_DX_LATEX + +if test -n "$DX_LATEX"; then + echo "$as_me:$LINENO: result: $DX_LATEX" >&5 +echo "${ECHO_T}$DX_LATEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_LATEX"; then + ac_pt_DX_LATEX=$DX_LATEX + # Extract the first word of "latex", so it can be a program name with args. +set dummy latex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_LATEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX + +if test -n "$ac_pt_DX_LATEX"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_LATEX" >&5 +echo "${ECHO_T}$ac_pt_DX_LATEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_LATEX=$ac_pt_DX_LATEX +else + DX_LATEX="$ac_cv_path_DX_LATEX" +fi + +if test "$DX_FLAG_ps$DX_LATEX" = 1; then + { echo "$as_me:$LINENO: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 +echo "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_MAKEINDEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX + +if test -n "$DX_MAKEINDEX"; then + echo "$as_me:$LINENO: result: $DX_MAKEINDEX" >&5 +echo "${ECHO_T}$DX_MAKEINDEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_MAKEINDEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX + +if test -n "$ac_pt_DX_MAKEINDEX"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_MAKEINDEX" >&5 +echo "${ECHO_T}$ac_pt_DX_MAKEINDEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then + { echo "$as_me:$LINENO: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 +echo "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. +set dummy ${ac_tool_prefix}dvips; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_DVIPS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DVIPS="$DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_DVIPS=$ac_cv_path_DX_DVIPS + +if test -n "$DX_DVIPS"; then + echo "$as_me:$LINENO: result: $DX_DVIPS" >&5 +echo "${ECHO_T}$DX_DVIPS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_DVIPS"; then + ac_pt_DX_DVIPS=$DX_DVIPS + # Extract the first word of "dvips", so it can be a program name with args. +set dummy dvips; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_DVIPS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS + +if test -n "$ac_pt_DX_DVIPS"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_DVIPS" >&5 +echo "${ECHO_T}$ac_pt_DX_DVIPS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_DVIPS=$ac_pt_DX_DVIPS +else + DX_DVIPS="$ac_cv_path_DX_DVIPS" +fi + +if test "$DX_FLAG_ps$DX_DVIPS" = 1; then + { echo "$as_me:$LINENO: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 +echo "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP + +if test -n "$DX_EGREP"; then + echo "$as_me:$LINENO: result: $DX_EGREP" >&5 +echo "${ECHO_T}$DX_EGREP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP + +if test -n "$ac_pt_DX_EGREP"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_EGREP" >&5 +echo "${ECHO_T}$ac_pt_DX_EGREP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_EGREP=$ac_pt_DX_EGREP +else + DX_EGREP="$ac_cv_path_DX_EGREP" +fi + +if test "$DX_FLAG_ps$DX_EGREP" = 1; then + { echo "$as_me:$LINENO: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 +echo "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + : +fi +if test "$DX_FLAG_ps" = 1; then + + +if :; then + DX_COND_ps_TRUE= + DX_COND_ps_FALSE='#' +else + DX_COND_ps_TRUE='#' + DX_COND_ps_FALSE= +fi + + + : +else + + +if false; then + DX_COND_ps_TRUE= + DX_COND_ps_FALSE='#' +else + DX_COND_ps_TRUE='#' + DX_COND_ps_FALSE= +fi + + + : +fi + + +# PDF file generation: + + + + # Check whether --enable-doxygen-pdf or --disable-doxygen-pdf was given. +if test "${enable_doxygen_pdf+set}" = set; then + enableval="$enable_doxygen_pdf" + +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_pdf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| { { echo "$as_me:$LINENO: error: doxygen-pdf requires doxygen-pdf" >&5 +echo "$as_me: error: doxygen-pdf requires doxygen-pdf" >&2;} + { (exit 1); exit 1; }; } + +;; #( +n|N|no|No|NO) + DX_FLAG_pdf=0 + +;; #( +*) + { { echo "$as_me:$LINENO: error: invalid value '$enableval' given to doxygen-pdf" >&5 +echo "$as_me: error: invalid value '$enableval' given to doxygen-pdf" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +else + +DX_FLAG_pdf=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 + + + +fi; +if test "$DX_FLAG_pdf" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. +set dummy ${ac_tool_prefix}pdflatex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_PDFLATEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX + +if test -n "$DX_PDFLATEX"; then + echo "$as_me:$LINENO: result: $DX_PDFLATEX" >&5 +echo "${ECHO_T}$DX_PDFLATEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_PDFLATEX"; then + ac_pt_DX_PDFLATEX=$DX_PDFLATEX + # Extract the first word of "pdflatex", so it can be a program name with args. +set dummy pdflatex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_PDFLATEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX + +if test -n "$ac_pt_DX_PDFLATEX"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_PDFLATEX" >&5 +echo "${ECHO_T}$ac_pt_DX_PDFLATEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_PDFLATEX=$ac_pt_DX_PDFLATEX +else + DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" +fi + +if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then + { echo "$as_me:$LINENO: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 +echo "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_MAKEINDEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX + +if test -n "$DX_MAKEINDEX"; then + echo "$as_me:$LINENO: result: $DX_MAKEINDEX" >&5 +echo "${ECHO_T}$DX_MAKEINDEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_MAKEINDEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX + +if test -n "$ac_pt_DX_MAKEINDEX"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_MAKEINDEX" >&5 +echo "${ECHO_T}$ac_pt_DX_MAKEINDEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then + { echo "$as_me:$LINENO: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 +echo "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DX_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP + +if test -n "$DX_EGREP"; then + echo "$as_me:$LINENO: result: $DX_EGREP" >&5 +echo "${ECHO_T}$DX_EGREP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_DX_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP + +if test -n "$ac_pt_DX_EGREP"; then + echo "$as_me:$LINENO: result: $ac_pt_DX_EGREP" >&5 +echo "${ECHO_T}$ac_pt_DX_EGREP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DX_EGREP=$ac_pt_DX_EGREP +else + DX_EGREP="$ac_cv_path_DX_EGREP" +fi + +if test "$DX_FLAG_pdf$DX_EGREP" = 1; then + { echo "$as_me:$LINENO: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 +echo "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + : +fi +if test "$DX_FLAG_pdf" = 1; then + + +if :; then + DX_COND_pdf_TRUE= + DX_COND_pdf_FALSE='#' +else + DX_COND_pdf_TRUE='#' + DX_COND_pdf_FALSE= +fi + + + : +else + + +if false; then + DX_COND_pdf_TRUE= + DX_COND_pdf_FALSE='#' +else + DX_COND_pdf_TRUE='#' + DX_COND_pdf_FALSE= +fi + + + : +fi + + +# LaTeX generation for PS and/or PDF: +if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then + + +if :; then + DX_COND_latex_TRUE= + DX_COND_latex_FALSE='#' +else + DX_COND_latex_TRUE='#' + DX_COND_latex_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_LATEX='YES'" + +else + + +if false; then + DX_COND_latex_TRUE= + DX_COND_latex_FALSE='#' +else + DX_COND_latex_TRUE='#' + DX_COND_latex_FALSE= +fi + + DX_ENV="$DX_ENV GENERATE_LATEX='NO'" + +fi + +# Paper size for PS and/or PDF: + +case "$DOXYGEN_PAPER_SIZE" in +#( +"") + DOXYGEN_PAPER_SIZE="" + +;; #( +a4wide|a4|letter|legal|executive) + DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" + +;; #( +*) + { { echo "$as_me:$LINENO: error: unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" >&5 +echo "$as_me: error: unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" >&2;} + { (exit 1); exit 1; }; } +;; +esac + +#For debugging: +#echo DX_FLAG_doc=$DX_FLAG_doc +#echo DX_FLAG_dot=$DX_FLAG_dot +#echo DX_FLAG_man=$DX_FLAG_man +#echo DX_FLAG_html=$DX_FLAG_html +#echo DX_FLAG_chm=$DX_FLAG_chm +#echo DX_FLAG_chi=$DX_FLAG_chi +#echo DX_FLAG_rtf=$DX_FLAG_rtf +#echo DX_FLAG_xml=$DX_FLAG_xml +#echo DX_FLAG_pdf=$DX_FLAG_pdf +#echo DX_FLAG_ps=$DX_FLAG_ps +#echo DX_ENV=$DX_ENV + +DX_INCLUDE= + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + enable_debug=$enableval +else + enable_debug=no +fi; + +if test "$enable_debug" = "yes" ; then + GCC_CFLAGS="$CFLAGS -g -D_DEBUG" + GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG" +else + GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG" + GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG" +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in gcc gcc3 cc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in gcc gcc3 cc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ g++3 c++ CC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ g++3 c++ CC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + +if test "$GCC" = "yes" ; then +# AC_HAVE_GCC_VERSION(4,0,0,0, +# [ +# AC_DEFINE(GCC_HASCLASSVISIBILITY,1, +# [Define to enable class visibility control in gcc.]) +# GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" +# GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" +# ]) + 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 + *solaris*) + if test "$CXX" = "CC" ; then + CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp" + fi + ;; + esac +fi + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=no +fi; + + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +SED=$lt_cv_path_SED + +fi + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 6096 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +esac + +need_locks="$enable_libtool_lock" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:7204:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris* | sysv5*) + symcode='[BDRT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# +# Check for any special shared library compilation flags. +# +lt_prog_cc_shlib= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + lt_prog_cc_shlib='-belf' + ;; + esac +fi +if test -n "$lt_prog_cc_shlib"; then + { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 +echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} + if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : + else + { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} + lt_cv_prog_cc_can_build_shared=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_prog_compiler_static" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8242: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8246: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $CC in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic='-Kpic' + lt_prog_compiler_static='-dn' + ;; + + solaris*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8475: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8479: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8535: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8539: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds="$tmp_archive_cmds" + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + archive_expsym_cmds="$tmp_archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi4*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes ; then + archive_cmds_need_lc=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + 10.*) + allow_undefined_flag='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='-all_load $convenience' + link_all_deplibs=yes + else + ld_shlibs=no + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 9869 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=yes + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var " || \ + test "X$hardcode_automatic"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which librarie types wil actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if test "$GCC" = yes; then + archive_cmds_need_lc=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + 10.*) + allow_undefined_flag='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='-all_load $convenience' + link_all_deplibs=yes + else + ld_shlibs=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_CXX=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX=' ' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_CXX=no + fi + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes; then + archive_cmds_need_lc_CXX=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='-flat_namespace -undefined suppress' + ;; + 10.*) + allow_undefined_flag_CXX='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='-all_load $convenience' + link_all_deplibs_CXX=yes + else + ld_shlibs_CXX=no + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd12*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + hardcode_libdir_separator_CXX=: + ;; + ia64*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + *) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + archive_cmds_need_lc_CXX=no + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sco*) + archive_cmds_need_lc_CXX=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.0-5 | solaris2.0-5.*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + archive_cmds_need_lc_CXX=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13021: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:13025: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13081: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:13085: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 13592 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=yes + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var CXX" || \ + test "X$hardcode_automatic_CXX"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + test "$enable_shared" = yes && enable_static=no + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +test "$ld_shlibs_F77" = no && can_build_shared=no + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $CC in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_F77='-Kpic' + lt_prog_compiler_static_F77='-dn' + ;; + + solaris*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15388: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15392: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15448: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15452: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_F77="$tmp_archive_cmds" + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + archive_expsym_cmds_F77="$tmp_archive_cmds" + fi + else + ld_shlibs_F77=no + fi + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_F77=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77=' ' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi4*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes ; then + archive_cmds_need_lc_F77=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='-flat_namespace -undefined suppress' + ;; + 10.*) + allow_undefined_flag_F77='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='-all_load $convenience' + link_all_deplibs_F77=yes + else + ld_shlibs_F77=no + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + ia64*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + *) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + sco3.2v5*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_F77='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv5*) + no_undefined_flag_F77=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_F77= + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 16762 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=yes + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var F77" || \ + test "X$hardcode_automatic_F77"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17507: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:17511: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $CC in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_GCJ='-Kpic' + lt_prog_compiler_static_GCJ='-dn' + ;; + + solaris*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17740: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:17744: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17800: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:17804: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_GCJ="$tmp_archive_cmds" + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + archive_expsym_cmds_GCJ="$tmp_archive_cmds" + fi + else + ld_shlibs_GCJ=no + fi + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_GCJ=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ=' ' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi4*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes ; then + archive_cmds_need_lc_GCJ=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='-all_load $convenience' + link_all_deplibs_GCJ=yes + else + ld_shlibs_GCJ=no + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + ia64*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + *) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + sco3.2v5*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv5*) + no_undefined_flag_GCJ=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_GCJ= + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 19134 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=yes + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var GCJ" || \ + test "X$hardcode_automatic_GCJ"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Checks for typedefs, structures, and compiler characteristics. +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + + +# Checks for library functions. + +for ac_func in strftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 +echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_strftime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strftime (); +int +main () +{ +strftime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_strftime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_intl_strftime=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 +if test $ac_cv_lib_intl_strftime = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_STRFTIME 1 +_ACEOF + +LIBS="-lintl $LIBS" +fi + +fi +done + +echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 +echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strerror_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strerror_r + char *p = (char *) strerror_r; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strerror_r=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_strerror_r=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6 +if test $ac_cv_have_decl_strerror_r = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R 0 +_ACEOF + + +fi + + + +for ac_func in strerror_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 +echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6 +if test "${ac_cv_func_strerror_r_char_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + extern char *strerror_r (); +int +main () +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + exit (!isalpha (x)); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + fi + +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 +echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6 +if test $ac_cv_func_strerror_r_char_p = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STRERROR_R_CHAR_P 1 +_ACEOF + +fi + + + + + + + + +for ac_func in strchr strdup strstr timegm gmtime_r strtok_r strcasecmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# checks for pthreads + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_join (); +int +main () +{ +pthread_join (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + acx_pthread_ok=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 +echo "${ECHO_T}$acx_pthread_ok" >&6 + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5 +echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6 + ;; + + -*) + echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5 +echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6 + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_acx_pthread_config+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$acx_pthread_config"; then + ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_acx_pthread_config="yes" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" +fi +fi +acx_pthread_config=$ac_cv_prog_acx_pthread_config +if test -n "$acx_pthread_config"; then + echo "$as_me:$LINENO: result: $acx_pthread_config" >&5 +echo "${ECHO_T}$acx_pthread_config" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5 +echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6 + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + acx_pthread_ok=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 +echo "${ECHO_T}$acx_pthread_ok" >&6 + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5 +echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6 + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +int attr=$attr; return attr; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + attr_name=$attr; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + echo "$as_me:$LINENO: result: $attr_name" >&5 +echo "${ECHO_T}$attr_name" >&6 + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 +echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6 + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; + *-osf* | *-hpux*) flag="-D_REENTRANT";; + *solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + echo "$as_me:$LINENO: result: ${flag}" >&5 +echo "${ECHO_T}${flag}" >&6 + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + for ac_prog in xlc_r cc_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5 +echo "${ECHO_T}$PTHREAD_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" + + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + enable_threads="pthread" + : +else + acx_pthread_ok=no + enable_threads="no" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +if test $enable_threads != "pthread"; then + { { echo "$as_me:$LINENO: error: unable to find pthreads, currently this is required" >&5 +echo "$as_me: error: unable to find pthreads, currently this is required" >&2;} + { (exit 1); exit 1; }; } +else + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PTHREAD 1 +_ACEOF + + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$PTHREAD_CFLAGS $CFLAGS" + CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS" +fi + +# Thank you Solaris, really. +echo "$as_me:$LINENO: checking for ctime_r" >&5 +echo $ECHO_N "checking for ctime_r... $ECHO_C" >&6 + if test -z "$ac_cv_ctime_args"; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + + time_t clock; + char buf[26]; + ctime_r(&clock, buf); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_ctime_args=2 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + + time_t clock; + char buf[26]; + ctime_r(&clock, buf, 26); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_ctime_args=3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test -z "$ac_cv_ctime_args"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + if test "$ac_cv_ctime_args" = 2; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CTIME_R_2 1 +_ACEOF + + elif test "$ac_cv_ctime_args" = 3; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CTIME_R_3 1 +_ACEOF + + fi + echo "$as_me:$LINENO: result: yes, and it takes $ac_cv_ctime_args arguments" >&5 +echo "${ECHO_T}yes, and it takes $ac_cv_ctime_args arguments" >&6 + fi + +# OpenSSL settings + +# Check whether --with-openssl or --without-openssl was given. +if test "${with_openssl+set}" = set; then + withval="$with_openssl" + if test x_$with_openssl != x_/usr; then + SSLFLAGS="-I${with_openssl}/include" + fi +fi; + +if test "x$SSLFLAGS" = "x" ; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then + if pkg-config openssl ; then + SSLFLAGS="`$PKG_CONFIG --cflags openssl`" + else + { { echo "$as_me:$LINENO: error: OpenSSL not supported by pkg-config, try --with-openssl instead" >&5 +echo "$as_me: error: OpenSSL not supported by pkg-config, try --with-openssl instead" >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi + +echo "$as_me:$LINENO: checking for OpenSSL cflags" >&5 +echo $ECHO_N "checking for OpenSSL cflags... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $SSLFLAGS" >&5 +echo "${ECHO_T}$SSLFLAGS" >&6 +CPPFLAGS="$SSLFLAGS $CPPFLAGS" + +if test "${ac_cv_header_openssl_x509_h+set}" = set; then + echo "$as_me:$LINENO: checking for openssl/x509.h" >&5 +echo $ECHO_N "checking for openssl/x509.h... $ECHO_C" >&6 +if test "${ac_cv_header_openssl_x509_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_openssl_x509_h" >&5 +echo "${ECHO_T}$ac_cv_header_openssl_x509_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking openssl/x509.h usability" >&5 +echo $ECHO_N "checking openssl/x509.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking openssl/x509.h presence" >&5 +echo $ECHO_N "checking openssl/x509.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: openssl/x509.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: openssl/x509.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: openssl/x509.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: openssl/x509.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: openssl/x509.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: openssl/x509.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: openssl/x509.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/x509.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: openssl/x509.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for openssl/x509.h" >&5 +echo $ECHO_N "checking for openssl/x509.h... $ECHO_C" >&6 +if test "${ac_cv_header_openssl_x509_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_openssl_x509_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_openssl_x509_h" >&5 +echo "${ECHO_T}$ac_cv_header_openssl_x509_h" >&6 + +fi +if test $ac_cv_header_openssl_x509_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find openssl header files" >&5 +echo "$as_me: error: unable to find openssl header files" >&2;} + { (exit 1); exit 1; }; } +fi + + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +# C++ requirements +echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5 +echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6 +if test "${ac_cv_cxx_namespaces+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +namespace Outer { namespace Inner { int i = 0; }} +int +main () +{ +using namespace Outer::Inner; return i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_namespaces=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_namespaces=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5 +echo "${ECHO_T}$ac_cv_cxx_namespaces" >&6 +if test "$ac_cv_cxx_namespaces" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NAMESPACES 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler supports Standard Template Library" >&5 +echo $ECHO_N "checking whether the compiler supports Standard Template Library... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_stl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif +int +main () +{ +list x; x.push_back(5); +list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_have_stl=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_have_stl=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_stl" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_stl" >&6 +if test "x_$ac_cv_cxx_have_stl" != x_yes; then + { { echo "$as_me:$LINENO: error: C++ Standard Template Libary unsupported" >&5 +echo "$as_me: error: C++ Standard Template Libary unsupported" >&2;} + { (exit 1); exit 1; }; } +fi + +echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5 +echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6 +if test "${ac_cv_cxx_namespaces+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +namespace Outer { namespace Inner { int i = 0; }} +int +main () +{ +using namespace Outer::Inner; return i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_namespaces=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_namespaces=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5 +echo "${ECHO_T}$ac_cv_cxx_namespaces" >&6 +if test "$ac_cv_cxx_namespaces" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NAMESPACES 1 +_ACEOF + +fi + + +# log4shib settings (favor this version over the log4cpp code) +# Extract the first word of "log4shib-config", so it can be a program name with args. +set dummy log4shib-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LOG4SHIB_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LOG4SHIB_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LOG4SHIB_CONFIG="$LOG4SHIB_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LOG4SHIB_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +LOG4SHIB_CONFIG=$ac_cv_path_LOG4SHIB_CONFIG + +if test -n "$LOG4SHIB_CONFIG"; then + echo "$as_me:$LINENO: result: $LOG4SHIB_CONFIG" >&5 +echo "${ECHO_T}$LOG4SHIB_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +# Check whether --with-log4shib or --without-log4shib was given. +if test "${with_log4shib+set}" = set; then + withval="$with_log4shib" + + LOG4SHIB_CONFIG="${with_log4shib}" + if ! test -f "${LOG4SHIB_CONFIG}" ; then + LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config" + fi + +fi; +if test -f "${LOG4SHIB_CONFIG}"; then + LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS" + CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS" + +if test "${ac_cv_header_log4shib_CategoryStream_hh+set}" = set; then + echo "$as_me:$LINENO: checking for log4shib/CategoryStream.hh" >&5 +echo $ECHO_N "checking for log4shib/CategoryStream.hh... $ECHO_C" >&6 +if test "${ac_cv_header_log4shib_CategoryStream_hh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_log4shib_CategoryStream_hh" >&5 +echo "${ECHO_T}$ac_cv_header_log4shib_CategoryStream_hh" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking log4shib/CategoryStream.hh usability" >&5 +echo $ECHO_N "checking log4shib/CategoryStream.hh usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking log4shib/CategoryStream.hh presence" >&5 +echo $ECHO_N "checking log4shib/CategoryStream.hh presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: present but cannot be compiled" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: log4shib/CategoryStream.hh: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: log4shib/CategoryStream.hh: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for log4shib/CategoryStream.hh" >&5 +echo $ECHO_N "checking for log4shib/CategoryStream.hh... $ECHO_C" >&6 +if test "${ac_cv_header_log4shib_CategoryStream_hh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_log4shib_CategoryStream_hh=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_log4shib_CategoryStream_hh" >&5 +echo "${ECHO_T}$ac_cv_header_log4shib_CategoryStream_hh" >&6 + +fi +if test $ac_cv_header_log4shib_CategoryStream_hh = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find log4shib header files" >&5 +echo "$as_me: error: unable to find log4shib header files" >&2;} + { (exit 1); exit 1; }; } +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +log4shib::Category::getInstance("foo").errorStream() << log4shib::eol + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define SHIBSP_LOG4SHIB 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: unable to link with log4shib" >&5 +echo "$as_me: error: unable to link with log4shib" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + { echo "$as_me:$LINENO: WARNING: log4shib-config not found, may need to use --with-log4shib option" >&5 +echo "$as_me: WARNING: log4shib-config not found, may need to use --with-log4shib option" >&2;} + { echo "$as_me:$LINENO: WARNING: will look for original log4cpp library" >&5 +echo "$as_me: WARNING: will look for original log4cpp library" >&2;} + + # log4cpp settings + # Extract the first word of "log4cpp-config", so it can be a program name with args. +set dummy log4cpp-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LOG4CPP_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LOG4CPP_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LOG4CPP_CONFIG="$LOG4CPP_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LOG4CPP_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +LOG4CPP_CONFIG=$ac_cv_path_LOG4CPP_CONFIG + +if test -n "$LOG4CPP_CONFIG"; then + echo "$as_me:$LINENO: result: $LOG4CPP_CONFIG" >&5 +echo "${ECHO_T}$LOG4CPP_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +# Check whether --with-log4cpp or --without-log4cpp was given. +if test "${with_log4cpp+set}" = set; then + withval="$with_log4cpp" + + LOG4CPP_CONFIG="${with_log4cpp}" + if ! test -f "${LOG4CPP_CONFIG}" ; then + LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config" + fi + +fi; + if test -f "${LOG4CPP_CONFIG}"; then + { echo "$as_me:$LINENO: WARNING: will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe" >&5 +echo "$as_me: WARNING: will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe" >&2;} + LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS" + CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS" + if test "${ac_cv_header_log4cpp_CategoryStream_hh+set}" = set; then + echo "$as_me:$LINENO: checking for log4cpp/CategoryStream.hh" >&5 +echo $ECHO_N "checking for log4cpp/CategoryStream.hh... $ECHO_C" >&6 +if test "${ac_cv_header_log4cpp_CategoryStream_hh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_log4cpp_CategoryStream_hh" >&5 +echo "${ECHO_T}$ac_cv_header_log4cpp_CategoryStream_hh" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking log4cpp/CategoryStream.hh usability" >&5 +echo $ECHO_N "checking log4cpp/CategoryStream.hh usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking log4cpp/CategoryStream.hh presence" >&5 +echo $ECHO_N "checking log4cpp/CategoryStream.hh presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: present but cannot be compiled" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: log4cpp/CategoryStream.hh: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: log4cpp/CategoryStream.hh: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for log4cpp/CategoryStream.hh" >&5 +echo $ECHO_N "checking for log4cpp/CategoryStream.hh... $ECHO_C" >&6 +if test "${ac_cv_header_log4cpp_CategoryStream_hh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_log4cpp_CategoryStream_hh=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_log4cpp_CategoryStream_hh" >&5 +echo "${ECHO_T}$ac_cv_header_log4cpp_CategoryStream_hh" >&6 + +fi +if test $ac_cv_header_log4cpp_CategoryStream_hh = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find log4cpp header files" >&5 +echo "$as_me: error: unable to find log4cpp header files" >&2;} + { (exit 1); exit 1; }; } +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define SHIBSP_LOG4CPP 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: unable to link with log4cpp, need version 1.0 or later" >&5 +echo "$as_me: error: unable to link with log4cpp, need version 1.0 or later" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + else + { { echo "$as_me:$LINENO: error: log4cpp-config not found, may need to use --with-log4cpp option" >&5 +echo "$as_me: error: log4cpp-config not found, may need to use --with-log4cpp option" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# Xerces settings + +# Check whether --with-xerces or --without-xerces was given. +if test "${with_xerces+set}" = set; then + withval="$with_xerces" + if test x_$with_xerces != x_/usr; then + LDFLAGS="-L${with_xerces}/lib $LDFLAGS" + CPPFLAGS="-I${with_xerces}/include $CPPFLAGS" + fi +fi; +LIBS="-lxerces-c $LIBS" +if test "${ac_cv_header_xercesc_dom_DOM_hpp+set}" = set; then + echo "$as_me:$LINENO: checking for xercesc/dom/DOM.hpp" >&5 +echo $ECHO_N "checking for xercesc/dom/DOM.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_xercesc_dom_DOM_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_xercesc_dom_DOM_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_xercesc_dom_DOM_hpp" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking xercesc/dom/DOM.hpp usability" >&5 +echo $ECHO_N "checking xercesc/dom/DOM.hpp usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking xercesc/dom/DOM.hpp presence" >&5 +echo $ECHO_N "checking xercesc/dom/DOM.hpp presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: present but cannot be compiled" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: xercesc/dom/DOM.hpp: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: xercesc/dom/DOM.hpp: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for xercesc/dom/DOM.hpp" >&5 +echo $ECHO_N "checking for xercesc/dom/DOM.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_xercesc_dom_DOM_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_xercesc_dom_DOM_hpp=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_xercesc_dom_DOM_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_xercesc_dom_DOM_hpp" >&6 + +fi +if test $ac_cv_header_xercesc_dom_DOM_hpp = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find xerces header files" >&5 +echo "$as_me: error: unable to find xerces header files" >&2;} + { (exit 1); exit 1; }; } +fi + + +echo "$as_me:$LINENO: checking Xerces version" >&5 +echo $ECHO_N "checking Xerces version... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +#if _XERCES_VERSION != 20600 +int i = 0; +#else +#error cannot use version 2.6.0 +#endif + ; + return 0; +} +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { { echo "$as_me:$LINENO: error: Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version +See \`config.log' for more details." >&5 +echo "$as_me: error: Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest.err conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +xercesc::XMLPlatformUtils::Initialize() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBXERCESC 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: unable to link with Xerces" >&5 +echo "$as_me: error: unable to link with Xerces" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +#XML-Tooling settings + +# Check whether --with-xmltooling or --without-xmltooling was given. +if test "${with_xmltooling+set}" = set; then + withval="$with_xmltooling" + if test x_$with_xmltooling != x_/usr; then + LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS" + CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS" + fi +fi; +LITE_LIBS="-lxmltooling-lite" +XMLSEC_LIBS="-lxmltooling" +if test "${ac_cv_header_xmltooling_base_h+set}" = set; then + echo "$as_me:$LINENO: checking for xmltooling/base.h" >&5 +echo $ECHO_N "checking for xmltooling/base.h... $ECHO_C" >&6 +if test "${ac_cv_header_xmltooling_base_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_xmltooling_base_h" >&5 +echo "${ECHO_T}$ac_cv_header_xmltooling_base_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking xmltooling/base.h usability" >&5 +echo $ECHO_N "checking xmltooling/base.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking xmltooling/base.h presence" >&5 +echo $ECHO_N "checking xmltooling/base.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: xmltooling/base.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: xmltooling/base.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: xmltooling/base.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: xmltooling/base.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: xmltooling/base.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: xmltooling/base.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: xmltooling/base.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: xmltooling/base.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: xmltooling/base.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for xmltooling/base.h" >&5 +echo $ECHO_N "checking for xmltooling/base.h... $ECHO_C" >&6 +if test "${ac_cv_header_xmltooling_base_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_xmltooling_base_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_xmltooling_base_h" >&5 +echo "${ECHO_T}$ac_cv_header_xmltooling_base_h" >&6 + +fi +if test $ac_cv_header_xmltooling_base_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find xmltooling header files" >&5 +echo "$as_me: error: unable to find xmltooling header files" >&2;} + { (exit 1); exit 1; }; } +fi + + + +# Establish location of xmltooling catalog. +XMLTOOLINGXMLDIR="" +if test "x$with_xmltooling" = "x" ; then + with_xmltooling="/usr" +fi +if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then + XMLTOOLINGXMLDIR="$with_xmltooling" +elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then + XMLTOOLINGXMLDIR="$with_xerces" +elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then + XMLTOOLINGXMLDIR="$with_log4shib" +fi +if test "x$XMLTOOLINGXMLDIR" = "x" ; then + { { echo "$as_me:$LINENO: error: xmltooling XML catalog not found, may need to use --with-xmltooling option" >&5 +echo "$as_me: error: xmltooling XML catalog not found, may need to use --with-xmltooling option" >&2;} + { (exit 1); exit 1; }; } +fi +XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling" + + +# XML-Security settings + +# Check whether --with-xmlsec or --without-xmlsec was given. +if test "${with_xmlsec+set}" = set; then + withval="$with_xmlsec" + +else + with_xmlsec=/usr +fi; + +if test x_$with_xmlsec != x_/usr; then + LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS" + CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS" +fi +XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS" + +# save and append master libs +save_LIBS="$LIBS" +LIBS="$XMLSEC_LIBS $LIBS" + +if test "${ac_cv_header_xsec_utils_XSECPlatformUtils_hpp+set}" = set; then + echo "$as_me:$LINENO: checking for xsec/utils/XSECPlatformUtils.hpp" >&5 +echo $ECHO_N "checking for xsec/utils/XSECPlatformUtils.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_xsec_utils_XSECPlatformUtils_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_xsec_utils_XSECPlatformUtils_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_xsec_utils_XSECPlatformUtils_hpp" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking xsec/utils/XSECPlatformUtils.hpp usability" >&5 +echo $ECHO_N "checking xsec/utils/XSECPlatformUtils.hpp usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking xsec/utils/XSECPlatformUtils.hpp presence" >&5 +echo $ECHO_N "checking xsec/utils/XSECPlatformUtils.hpp presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: present but cannot be compiled" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: xsec/utils/XSECPlatformUtils.hpp: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: xsec/utils/XSECPlatformUtils.hpp: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for xsec/utils/XSECPlatformUtils.hpp" >&5 +echo $ECHO_N "checking for xsec/utils/XSECPlatformUtils.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_xsec_utils_XSECPlatformUtils_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_xsec_utils_XSECPlatformUtils_hpp=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_xsec_utils_XSECPlatformUtils_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_xsec_utils_XSECPlatformUtils_hpp" >&6 + +fi +if test $ac_cv_header_xsec_utils_XSECPlatformUtils_hpp = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find XML-Security header files" >&5 +echo "$as_me: error: unable to find XML-Security header files" >&2;} + { (exit 1); exit 1; }; } +fi + + +echo "$as_me:$LINENO: checking XML-Security version" >&5 +echo $ECHO_N "checking XML-Security version... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3) +int i = 0; +#else +#error need version 1.4.0 or later +#endif + ; + return 0; +} +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { { echo "$as_me:$LINENO: error: XML-Security version 1.4.0 or greater is required. +See \`config.log' for more details." >&5 +echo "$as_me: error: XML-Security version 1.4.0 or greater is required. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest.err conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XSECPlatformUtils::Initialise() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: unable to link with XML-Security" >&5 +echo "$as_me: error: unable to link with XML-Security" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +# restore master libs +LIBS="$save_LIBS" + +# OpenSAML settings + +# Check whether --with-saml or --without-saml was given. +if test "${with_saml+set}" = set; then + withval="$with_saml" + if test x_$with_saml != x_/usr; then + LDFLAGS="-L${with_saml}/lib $LDFLAGS" + CPPFLAGS="-I${with_saml}/include $CPPFLAGS" + fi +fi; +XMLSEC_LIBS="-lsaml $XMLSEC_LIBS" + +# save and append master libs +save_LIBS="$LIBS" +LIBS="$XMLSEC_LIBS $LIBS" + +if test "${ac_cv_header_saml_saml2_metadata_Metadata_h+set}" = set; then + echo "$as_me:$LINENO: checking for saml/saml2/metadata/Metadata.h" >&5 +echo $ECHO_N "checking for saml/saml2/metadata/Metadata.h... $ECHO_C" >&6 +if test "${ac_cv_header_saml_saml2_metadata_Metadata_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_saml_saml2_metadata_Metadata_h" >&5 +echo "${ECHO_T}$ac_cv_header_saml_saml2_metadata_Metadata_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking saml/saml2/metadata/Metadata.h usability" >&5 +echo $ECHO_N "checking saml/saml2/metadata/Metadata.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking saml/saml2/metadata/Metadata.h presence" >&5 +echo $ECHO_N "checking saml/saml2/metadata/Metadata.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: saml/saml2/metadata/Metadata.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: saml/saml2/metadata/Metadata.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for saml/saml2/metadata/Metadata.h" >&5 +echo $ECHO_N "checking for saml/saml2/metadata/Metadata.h... $ECHO_C" >&6 +if test "${ac_cv_header_saml_saml2_metadata_Metadata_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_saml_saml2_metadata_Metadata_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_saml_saml2_metadata_Metadata_h" >&5 +echo "${ECHO_T}$ac_cv_header_saml_saml2_metadata_Metadata_h" >&6 + +fi +if test $ac_cv_header_saml_saml2_metadata_Metadata_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find OpenSAML header files" >&5 +echo "$as_me: error: unable to find OpenSAML header files" >&2;} + { (exit 1); exit 1; }; } +fi + + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +#if _OPENSAML_VERSION >= 20000 +opensaml::SAMLConfig::getConfig(); +#else +#error Need OpenSAML version 2.0 or higher +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SAML 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: unable to link with OpenSAML, or version was too old" >&5 +echo "$as_me: error: unable to link with OpenSAML, or version was too old" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +# restore master libs +LIBS="$save_LIBS" + +# Establish location of opensaml catalogs. +OPENSAMLXMLDIR="" +if test "x$with_saml" = "x" ; then + with_saml="/usr" +fi +if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_saml" +elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_xmltooling" +elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_xerces" +elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_log4shib" +fi +if test "x$OPENSAMLXMLDIR" = "x" ; then + { { echo "$as_me:$LINENO: error: opensaml XML catalogs not found, may need to use --with-saml option" >&5 +echo "$as_me: error: opensaml XML catalogs not found, may need to use --with-saml option" >&2;} + { (exit 1); exit 1; }; } +fi +OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml" + + + + + +# output the underlying makefiles +WANT_SUBDIRS="doc schemas configs shibsp shibd util" + ac_config_files="$ac_config_files Makefile doc/Makefile schemas/Makefile configs/Makefile shibsp/Makefile shibd/Makefile util/Makefile selinux/Makefile" + + +## ADFS? + ac_config_files="$ac_config_files adfs/Makefile" + +# Check whether --enable-adfs or --disable-adfs was given. +if test "${enable_adfs+set}" = set; then + enableval="$enable_adfs" + adfs_enabled=$enableval +else + adfs_enabled=yes +fi; +if test "x$adfs_enabled" = "x" ; then + adfs_enabled=yes +fi +echo "$as_me:$LINENO: checking whether to build the ADFS module" >&5 +echo $ECHO_N "checking whether to build the ADFS module... $ECHO_C" >&6 +if test "$adfs_enabled" = "no" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + WANT_SUBDIRS="$WANT_SUBDIRS adfs" +fi + + +# +# Build NSAPI module? +# +echo "$as_me:$LINENO: checking for NSAPI module option" >&5 +echo $ECHO_N "checking for NSAPI module option... $ECHO_C" >&6 + +# Check whether --with-nsapi or --without-nsapi was given. +if test "${with_nsapi+set}" = set; then + withval="$with_nsapi" + WANT_NSAPI=$withval +else + WANT_NSAPI=no +fi; +echo "$as_me:$LINENO: result: $WANT_NSAPI" >&5 +echo "${ECHO_T}$WANT_NSAPI" >&6 + +if test "$WANT_NSAPI" != "no"; then + if test ! -d $WANT_NSAPI/bin ; then + { { echo "$as_me:$LINENO: error: Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR" >&5 +echo "$as_me: error: Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR" >&2;} + { (exit 1); exit 1; }; } + fi + echo "$as_me:$LINENO: checking for NSAPI include files" >&5 +echo $ECHO_N "checking for NSAPI include files... $ECHO_C" >&6 + if test -d $WANT_NSAPI/include ; then + NSAPI_INCLUDE=$WANT_NSAPI/include + echo "$as_me:$LINENO: result: Netscape-Enterprise 3.x style" >&5 +echo "${ECHO_T}Netscape-Enterprise 3.x style" >&6 + +for ac_header in $NSAPI_INCLUDE/nsapi.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define XP_UNIX + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE" + fi + if test -d $WANT_NSAPI/plugins/include ; then + test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE" + NSAPI_INCLUDE="$WANT_NSAPI/plugins/include" + echo "$as_me:$LINENO: result: iPlanet 4.x / SunONE 6.x style" >&5 +echo "${ECHO_T}iPlanet 4.x / SunONE 6.x style" >&6 + +for ac_header in $NSAPI_INCLUDE/nsapi.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define XP_UNIX + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE" + fi + if test "$NSAPI_INCLUDE" = ""; then + { { echo "$as_me:$LINENO: error: Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include" >&5 +echo "$as_me: error: Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include" >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# always output the Makefile, even if you don't use it + ac_config_files="$ac_config_files nsapi_shib/Makefile" + + + +if test ! "$WANT_NSAPI" = "no"; then + BUILD_NSAPI_TRUE= + BUILD_NSAPI_FALSE='#' +else + BUILD_NSAPI_TRUE='#' + BUILD_NSAPI_FALSE= +fi + + +# add the NSAPI module to the list of wanted subdirs.. +if test ! "$WANT_NSAPI" = "no" ; then + WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib" +fi + + +# +# Build FastCGI support? +# +echo "$as_me:$LINENO: checking for FastCGI support" >&5 +echo $ECHO_N "checking for FastCGI support... $ECHO_C" >&6 + +# Check whether --with-fastcgi or --without-fastcgi was given. +if test "${with_fastcgi+set}" = set; then + withval="$with_fastcgi" + WANT_FASTCGI=$withval +else + WANT_FASTCGI=no +fi; +echo "$as_me:$LINENO: result: $WANT_FASTCGI" >&5 +echo "${ECHO_T}$WANT_FASTCGI" >&6 + +if test "$WANT_FASTCGI" != "no"; then + if test "$WANT_FASTCGI" != "yes"; then + if test x_$WANT_FASTCGI != x_/usr; then + FASTCGI_INCLUDE="-I$WANT_FASTCGI/include" + FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib" + fi + fi + if test "${ac_cv_header_fcgio_h+set}" = set; then + echo "$as_me:$LINENO: checking for fcgio.h" >&5 +echo $ECHO_N "checking for fcgio.h... $ECHO_C" >&6 +if test "${ac_cv_header_fcgio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_fcgio_h" >&5 +echo "${ECHO_T}$ac_cv_header_fcgio_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking fcgio.h usability" >&5 +echo $ECHO_N "checking fcgio.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking fcgio.h presence" >&5 +echo $ECHO_N "checking fcgio.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: fcgio.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: fcgio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: fcgio.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: fcgio.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: fcgio.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: fcgio.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: fcgio.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: fcgio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: fcgio.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: fcgio.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: fcgio.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: fcgio.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: fcgio.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: fcgio.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: fcgio.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: fcgio.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for fcgio.h" >&5 +echo $ECHO_N "checking for fcgio.h... $ECHO_C" >&6 +if test "${ac_cv_header_fcgio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_fcgio_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_fcgio_h" >&5 +echo "${ECHO_T}$ac_cv_header_fcgio_h" >&6 + +fi +if test $ac_cv_header_fcgio_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: unable to find FastCGI header files" >&5 +echo "$as_me: error: unable to find FastCGI header files" >&2;} + { (exit 1); exit 1; }; } +fi + + + FASTCGI_LIBS="-lfcgi -lfcgi++" +fi + + + + + +# always output the Makefile, even if you don't use it + ac_config_files="$ac_config_files fastcgi/Makefile" + + + +if test ! "$WANT_FASTCGI" = "no"; then + BUILD_FASTCGI_TRUE= + BUILD_FASTCGI_FALSE='#' +else + BUILD_FASTCGI_TRUE='#' + BUILD_FASTCGI_FALSE= +fi + + +if test ! "$WANT_FASTCGI" = "no" ; then + WANT_SUBDIRS="$WANT_SUBDIRS fastcgi" +fi + + +# +# If no --enable-apache-xx specified +# find a default and fake the specific parameters +# + +# simple macro to peek at an enable or a with + + +echo "$as_me:$LINENO: checking if default apache needed" >&5 +echo $ECHO_N "checking if default apache needed... $ECHO_C" >&6 +need_default=yes +if test "${enable_apache_13+set}" = set; then + peekval="${enable_apache_13}" + need_default=no +fi; +if test "${enable_apache_20+set}" = set; then + peekval="${enable_apache_20}" + need_default=no +fi; +if test "${enable_apache_22+set}" = set; then + peekval="${enable_apache_22}" + need_default=no +fi; +echo "$as_me:$LINENO: result: $need_default" >&5 +echo "${ECHO_T}$need_default" >&6 + +if test "$need_default" = "yes"; then + # find an apxs, then the httpd + xs= + if test "${with_apxs+set}" = set; then + peekval="${with_apxs}" + xs="$peekval" +fi; + if test "${with_apxs2+set}" = set; then + peekval="${with_apxs2}" + xs="$peekval" +fi; + if test "${with_apxs22+set}" = set; then + peekval="${with_apxs22}" + xs="$peekval" +fi; + if test "x$xs" = "x"; then + for ac_prog in apxs2 apxs +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_xs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $xs in + [\\/]* | ?:[\\/]*) + ac_cv_path_xs="$xs" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_xs="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +xs=$ac_cv_path_xs + +if test -n "$xs"; then + echo "$as_me:$LINENO: result: $xs" >&5 +echo "${ECHO_T}$xs" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$xs" && break +done +test -n "$xs" || xs="{ { echo "$as_me:$LINENO: error: No apxs" >&5 +echo "$as_me: error: No apxs" >&2;} + { (exit no apache found. Try --with-apxs); exit no apache found. Try --with-apxs; }; }" + + fi + # ask the daemon for the version and set parameters + echo "$as_me:$LINENO: checking default apache version" >&5 +echo $ECHO_N "checking default apache version... $ECHO_C" >&6 + httpd="`$xs -q SBINDIR`/`$xs -q TARGET`" + if test "x$httpd" != "x" && test -f $httpd ; then + v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'` + case $v in + 1.3*) enable_apache_13=yes + with_apxs=$xs + echo "$as_me:$LINENO: result: 1.3" >&5 +echo "${ECHO_T}1.3" >&6 + ;; + 2.0*) enable_apache_20=yes + with_apxs2=$xs + echo "$as_me:$LINENO: result: 2.0" >&5 +echo "${ECHO_T}2.0" >&6 + ;; + 2.2*) enable_apache_22=yes + with_apxs22=$xs + echo "$as_me:$LINENO: result: 2.2" >&5 +echo "${ECHO_T}2.2" >&6 + ;; + *) { { echo "$as_me:$LINENO: error: unusable apache versions: $v. Try setting --with-apxs" >&5 +echo "$as_me: error: unusable apache versions: $v. Try setting --with-apxs" >&2;} + { (exit 1); exit 1; }; } + esac + else + echo "$as_me:$LINENO: result: cannot determine version. Try setting --with-apxs" >&5 +echo "${ECHO_T}cannot determine version. Try setting --with-apxs" >&6 + fi +fi + +# Apache 1.3 (mod_shib_13) +# --enable-apache-13 +# --with-apxs (DSO build, the normal way, uses apxs to derive build flags) + +# Check whether --enable-apache-13 or --disable-apache-13 was given. +if test "${enable_apache_13+set}" = set; then + enableval="$enable_apache_13" + if test "x$enableval" = "x" ; then + WANT_APACHE_13=yes + else + WANT_APACHE_13="$enableval" + fi + +else + WANT_APACHE_13=no +fi; +echo "$as_me:$LINENO: checking whether to build Apache 1.3 module" >&5 +echo $ECHO_N "checking whether to build Apache 1.3 module... $ECHO_C" >&6 +if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then + WANT_APACHE_13=yes +fi +echo "$as_me:$LINENO: result: $WANT_APACHE_13" >&5 +echo "${ECHO_T}$WANT_APACHE_13" >&6 + +if test "$WANT_APACHE_13" = "yes" ; then + +# Check whether --with-apxs or --without-apxs was given. +if test "${with_apxs+set}" = set; then + withval="$with_apxs" + + echo "$as_me:$LINENO: checking for user-specified apxs name/location" >&5 +echo $ECHO_N "checking for user-specified apxs name/location... $ECHO_C" >&6 + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APXS=$withval + echo "$as_me:$LINENO: result: \"$withval\"" >&5 +echo "${ECHO_T}\"$withval\"" >&6 + fi + fi + +else + + # Extract the first word of "apxs", so it can be a program name with args. +set dummy apxs; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_APXS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $APXS in + [\\/]* | ?:[\\/]*) + ac_cv_path_APXS="$APXS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_APXS="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_APXS" && ac_cv_path_APXS="no" + ;; +esac +fi +APXS=$ac_cv_path_APXS + +if test -n "$APXS"; then + echo "$as_me:$LINENO: result: $APXS" >&5 +echo "${ECHO_T}$APXS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "$APXS" = "no" ; then + for i in /usr/sbin /usr/local/apache/bin ; do + if test "$APXS" = "no" && test -f "$i/apxs"; then + APXS="$i/apxs" + fi + done + fi + +fi; + + echo "$as_me:$LINENO: checking to see if apxs was located" >&5 +echo $ECHO_N "checking to see if apxs was located... $ECHO_C" >&6 + if test ! -f "$APXS" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: Unable to locate apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs option." >&5 +echo "$as_me: error: Unable to locate apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs option." >&2;} + { (exit 1); exit 1; }; } + fi + echo "$as_me:$LINENO: result: $APXS" >&5 +echo "${ECHO_T}$APXS" >&6 + + + # extract settings we need from APXS -q + APXS_CC="`$APXS -q CC`" + APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`" + APXS_INCLUDE="`$APXS -q INCLUDEDIR`" +fi + + + + + +# Apache 2.0 (mod_shib_20) +# --enable-apache-20 +# --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags) +# --with-apr (DSO build, APR development package installed separately) + +# Check whether --enable-apache-20 or --disable-apache-20 was given. +if test "${enable_apache_20+set}" = set; then + enableval="$enable_apache_20" + if test "x$enableval" = "x" ; then + WANT_APACHE_20=yes + else + WANT_APACHE_20="$enableval" + fi + +else + WANT_APACHE_20=no +fi; +echo "$as_me:$LINENO: checking whether to build Apache 2.0 module" >&5 +echo $ECHO_N "checking whether to build Apache 2.0 module... $ECHO_C" >&6 +if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then + WANT_APACHE_20=yes +fi +echo "$as_me:$LINENO: result: $WANT_APACHE_20" >&5 +echo "${ECHO_T}$WANT_APACHE_20" >&6 + +if test "$WANT_APACHE_20" = "yes" ; then + +# Check whether --with-apxs2 or --without-apxs2 was given. +if test "${with_apxs2+set}" = set; then + withval="$with_apxs2" + + echo "$as_me:$LINENO: checking for user-specified Apache2 apxs name/location" >&5 +echo $ECHO_N "checking for user-specified Apache2 apxs name/location... $ECHO_C" >&6 + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APXS2=$withval + echo "$as_me:$LINENO: result: \"$withval\"" >&5 +echo "${ECHO_T}\"$withval\"" >&6 + fi + fi + +else + + # Extract the first word of "apxs2", so it can be a program name with args. +set dummy apxs2; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_APXS2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $APXS2 in + [\\/]* | ?:[\\/]*) + ac_cv_path_APXS2="$APXS2" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_APXS2="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_APXS2" && ac_cv_path_APXS2="no" + ;; +esac +fi +APXS2=$ac_cv_path_APXS2 + +if test -n "$APXS2"; then + echo "$as_me:$LINENO: result: $APXS2" >&5 +echo "${ECHO_T}$APXS2" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "$APXS2" = "no" ; then + # Extract the first word of "apxs", so it can be a program name with args. +set dummy apxs; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_APXS2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $APXS2 in + [\\/]* | ?:[\\/]*) + ac_cv_path_APXS2="$APXS2" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_APXS2="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_APXS2" && ac_cv_path_APXS2="no" + ;; +esac +fi +APXS2=$ac_cv_path_APXS2 + +if test -n "$APXS2"; then + echo "$as_me:$LINENO: result: $APXS2" >&5 +echo "${ECHO_T}$APXS2" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + fi + if test "$APXS2" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS2" = "no" && test -f "$i/apxs2" ; then + APXS2="$i/apxs2" + fi + done + if test "$APXS2" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS2" = "no" && test -f "$i/apxs" ; then + APXS2="$i/apxs" + fi + done + fi + fi + +fi; + + echo "$as_me:$LINENO: checking to see if Apache2 apxs was located" >&5 +echo $ECHO_N "checking to see if Apache2 apxs was located... $ECHO_C" >&6 + if test ! -f "$APXS2" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: Unable to locate Apache2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs2 option." >&5 +echo "$as_me: error: Unable to locate Apache2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs2 option." >&2;} + { (exit 1); exit 1; }; } + fi + echo "$as_me:$LINENO: result: $APXS2" >&5 +echo "${ECHO_T}$APXS2" >&6 + + + # APR settings + +# Check whether --with-apr or --without-apr was given. +if test "${with_apr+set}" = set; then + withval="$with_apr" + + echo "$as_me:$LINENO: checking for user-specified apr-config name/location" >&5 +echo $ECHO_N "checking for user-specified apr-config name/location... $ECHO_C" >&6 + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APR_CONFIG=$withval + echo "$as_me:$LINENO: result: \"$withval\"" >&5 +echo "${ECHO_T}\"$withval\"" >&6 + fi + fi + +else + + # Extract the first word of "apr-config", so it can be a program name with args. +set dummy apr-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_APR_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $APR_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_APR_CONFIG="$APR_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="`$APXS2 -q SBINDIR`:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_APR_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +APR_CONFIG=$ac_cv_path_APR_CONFIG + +if test -n "$APR_CONFIG"; then + echo "$as_me:$LINENO: result: $APR_CONFIG" >&5 +echo "${ECHO_T}$APR_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +fi; + if test -f "${APR_CONFIG}"; then + APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`" + else + { { echo "$as_me:$LINENO: error: Unable to locate apr-config, may need --with-apr option." >&5 +echo "$as_me: error: Unable to locate apr-config, may need --with-apr option." >&2;} + { (exit 1); exit 1; }; } + fi + + # extract settings we need from APXS2 -q + APXS2_CC="`$APXS2 -q CC`" + APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS" + APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`" +fi + + + + + +# Apache 2.2 (mod_shib_22) +# --enable-apache-22 +# --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags) +# --with-apr1 (DSO build, APR development package installed separately) + +# Check whether --enable-apache-22 or --disable-apache-22 was given. +if test "${enable_apache_22+set}" = set; then + enableval="$enable_apache_22" + if test "x$enableval" = "x" ; then + WANT_APACHE_22=yes + else + WANT_APACHE_22="$enableval" + fi + +else + WANT_APACHE_22=no +fi; +echo "$as_me:$LINENO: checking whether to build Apache 2.2 module" >&5 +echo $ECHO_N "checking whether to build Apache 2.2 module... $ECHO_C" >&6 +if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then + WANT_APACHE_22=yes +fi +echo "$as_me:$LINENO: result: $WANT_APACHE_22" >&5 +echo "${ECHO_T}$WANT_APACHE_22" >&6 + +if test "$WANT_APACHE_22" = "yes" ; then + +# Check whether --with-apxs22 or --without-apxs22 was given. +if test "${with_apxs22+set}" = set; then + withval="$with_apxs22" + + echo "$as_me:$LINENO: checking for user-specified Apache2.2 apxs name/location" >&5 +echo $ECHO_N "checking for user-specified Apache2.2 apxs name/location... $ECHO_C" >&6 + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APXS22=$withval + echo "$as_me:$LINENO: result: \"$withval\"" >&5 +echo "${ECHO_T}\"$withval\"" >&6 + fi + fi + +else + + # Extract the first word of "apxs2", so it can be a program name with args. +set dummy apxs2; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_APXS22+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $APXS22 in + [\\/]* | ?:[\\/]*) + ac_cv_path_APXS22="$APXS22" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_APXS22="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_APXS22" && ac_cv_path_APXS22="no" + ;; +esac +fi +APXS22=$ac_cv_path_APXS22 + +if test -n "$APXS22"; then + echo "$as_me:$LINENO: result: $APXS22" >&5 +echo "${ECHO_T}$APXS22" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "$APXS22" = "no" ; then + # Extract the first word of "apxs", so it can be a program name with args. +set dummy apxs; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_APXS22+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $APXS22 in + [\\/]* | ?:[\\/]*) + ac_cv_path_APXS22="$APXS22" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_APXS22="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_APXS22" && ac_cv_path_APXS22="no" + ;; +esac +fi +APXS22=$ac_cv_path_APXS22 + +if test -n "$APXS22"; then + echo "$as_me:$LINENO: result: $APXS22" >&5 +echo "${ECHO_T}$APXS22" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + fi + if test "$APXS22" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS22" = "no" && test -f "$i/apxs2" ; then + APXS22="$i/apxs2" + fi + done + if test "$APXS22" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS22" = "no" && test -f "$i/apxs" ; then + APXS22="$i/apxs" + fi + done + fi + fi + +fi; + + echo "$as_me:$LINENO: checking to see if Apache2.2 apxs was located" >&5 +echo $ECHO_N "checking to see if Apache2.2 apxs was located... $ECHO_C" >&6 + if test ! -f "$APXS22" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: Unable to locate Apache2.2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs22 option." >&5 +echo "$as_me: error: Unable to locate Apache2.2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs22 option." >&2;} + { (exit 1); exit 1; }; } + fi + echo "$as_me:$LINENO: result: $APXS22" >&5 +echo "${ECHO_T}$APXS22" >&6 + + + # APR1 settings + +# Check whether --with-apr1 or --without-apr1 was given. +if test "${with_apr1+set}" = set; then + withval="$with_apr1" + + echo "$as_me:$LINENO: checking for user-specified apr-1-config name/location" >&5 +echo $ECHO_N "checking for user-specified apr-1-config name/location... $ECHO_C" >&6 + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APR1_CONFIG=$withval + echo "$as_me:$LINENO: result: \"$withval\"" >&5 +echo "${ECHO_T}\"$withval\"" >&6 + fi + fi + +else + + # Extract the first word of "apr-1-config", so it can be a program name with args. +set dummy apr-1-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_APR1_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $APR1_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_APR1_CONFIG="$APR1_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="`$APXS22 -q SBINDIR`:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_APR1_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +APR1_CONFIG=$ac_cv_path_APR1_CONFIG + +if test -n "$APR1_CONFIG"; then + echo "$as_me:$LINENO: result: $APR1_CONFIG" >&5 +echo "${ECHO_T}$APR1_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +fi; + if test -f "${APR1_CONFIG}"; then + APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`" + else + { { echo "$as_me:$LINENO: error: Unable to locate apr-1-config, may need --with-apr1 option." >&5 +echo "$as_me: error: Unable to locate apr-1-config, may need --with-apr1 option." >&2;} + { (exit 1); exit 1; }; } + fi + + # extract settings we need from APXS22 -q + APXS22_CC="`$APXS22 -q CC`" + APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS" + APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`" +fi + + + + +# always output the Makefile, even if you don't use it + ac_config_files="$ac_config_files apache/Makefile" + + + +if test "$WANT_APACHE_13" = "yes"; then + BUILD_AP13_TRUE= + BUILD_AP13_FALSE='#' +else + BUILD_AP13_TRUE='#' + BUILD_AP13_FALSE= +fi + + + +if test "$WANT_APACHE_20" = "yes"; then + BUILD_AP20_TRUE= + BUILD_AP20_FALSE='#' +else + BUILD_AP20_TRUE='#' + BUILD_AP20_FALSE= +fi + + + +if test "$WANT_APACHE_22" = "yes"; then + BUILD_AP22_TRUE= + BUILD_AP22_FALSE='#' +else + BUILD_AP22_TRUE='#' + BUILD_AP22_FALSE= +fi + + +# add the apache module to the list of wanted subdirs.. +if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then + WANT_SUBDIRS="$WANT_SUBDIRS apache" +fi + + +# +# Implement the checks of the ODBC Storage Service +# +# 1) Assume the user wants ODBC; if it's not found then just continue without +# 2) If the user specifically requested odbc, look for it and ERROR if not found +# 3) If the user specifically requested no odbc, don't build it. +# + + ac_config_files="$ac_config_files odbc-store/Makefile" + + +# determine whether we should enable the odbc ccache +# Check whether --enable-odbc or --disable-odbc was given. +if test "${enable_odbc+set}" = set; then + enableval="$enable_odbc" + odbc_enabled=$enableval +else + odbc_enabled=default +fi; + +if test "x$odbc_enabled" = "x" ; then + odbc_enabled=yes +fi + +# Are we trying to build ODBC? +echo "$as_me:$LINENO: checking whether to build the ODBC storage service" >&5 +echo $ECHO_N "checking whether to build the ODBC storage service... $ECHO_C" >&6 +if test "$odbc_enabled" = "yes" ; then + build_odbc=yes + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +elif test "$odbc_enabled" = "default" ; then + build_odbc=yes + echo "$as_me:$LINENO: result: yes, if it can be found" >&5 +echo "${ECHO_T}yes, if it can be found" >&6 +else + build_odbc=no + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# If we're trying to build ODBC, try to find the odbc_config program. +if test "$build_odbc" = "yes" ; then + odbc_dir="" + +# Check whether --with-odbc or --without-odbc was given. +if test "${with_odbc+set}" = set; then + withval="$with_odbc" + if test "$with_odbc" = no ; then + { { echo "$as_me:$LINENO: error: Try running --disable-odbc instead." >&5 +echo "$as_me: error: Try running --disable-odbc instead." >&2;} + { (exit 1); exit 1; }; } + elif test "$with_odbc" != yes ; then + odbc_dir="$with_odbc/bin" + if test "$with_odbc" != /usr ; then + ODBC_CFLAGS="-I$with_odbc/include" + ODBC_LIBS="-L$with_odbc/lib" + fi + fi +fi; + + # Extract the first word of "odbc_config", so it can be a program name with args. +set dummy odbc_config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ODBC_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ODBC_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ODBC_CONFIG="$ODBC_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $odbc_dir $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ODBC_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_ODBC_CONFIG" && ac_cv_path_ODBC_CONFIG="no" + ;; +esac +fi +ODBC_CONFIG=$ac_cv_path_ODBC_CONFIG + +if test -n "$ODBC_CONFIG"; then + echo "$as_me:$LINENO: result: $ODBC_CONFIG" >&5 +echo "${ECHO_T}$ODBC_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "$ODBC_CONFIG" = no ; then + { echo "$as_me:$LINENO: WARNING: Cannot find odbc_config, will try to guess settings." >&5 +echo "$as_me: WARNING: Cannot find odbc_config, will try to guess settings." >&2;} + ODBC_LIBS="$ODBC_LIBS -lodbc" + else + ODBC_CFLAGS=`$ODBC_CONFIG --cflags` + ODBC_LIBS=`$ODBC_CONFIG --libs` + fi + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS" + + if test "${ac_cv_header_sql_h+set}" = set; then + echo "$as_me:$LINENO: checking for sql.h" >&5 +echo $ECHO_N "checking for sql.h... $ECHO_C" >&6 +if test "${ac_cv_header_sql_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sql_h" >&5 +echo "${ECHO_T}$ac_cv_header_sql_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sql.h usability" >&5 +echo $ECHO_N "checking sql.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sql.h presence" >&5 +echo $ECHO_N "checking sql.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sql.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sql.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sql.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sql.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sql.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sql.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sql.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sql.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sql.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sql.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sql.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sql.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sql.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sql.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sql.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sql.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------- ## +## Report this to shibboleth-users@internet2.edu ## +## --------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sql.h" >&5 +echo $ECHO_N "checking for sql.h... $ECHO_C" >&6 +if test "${ac_cv_header_sql_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sql_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sql_h" >&5 +echo "${ECHO_T}$ac_cv_header_sql_h" >&6 + +fi +if test $ac_cv_header_sql_h = yes; then + have_sql_h=yes +else + have_sql_h=no +fi + + + if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then + { { echo "$as_me:$LINENO: error: unable to find ODBC header files" >&5 +echo "$as_me: error: unable to find ODBC header files" >&2;} + { (exit 1); exit 1; }; } + fi + + if test "$have_sql_h" = yes ; then + save_LIBS="$LIBS" + LIBS="$LIBS $ODBC_LIBS" + echo "$as_me:$LINENO: checking if we can link againt ODBC" >&5 +echo $ECHO_N "checking if we can link againt ODBC... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + #include +int +main () +{ +SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + have_odbc_libs=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +have_odbc_libs=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + + if test "$have_odbc_libs" = no ; then + if test "$odbc_enabled" = "yes" ; then + { { echo "$as_me:$LINENO: error: unable to link with ODBC Library" >&5 +echo "$as_me: error: unable to link with ODBC Library" >&2;} + { (exit 1); exit 1; }; } + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + fi + fi + + CPPFLAGS="$save_CPPFLAGS" +fi + +# if have_odbc_libs=yes then go ahead with building ODBC +if test "$have_odbc_libs" = yes ; then + # this AC_MSG_RESULT is from above! + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + WANT_SUBDIRS="$WANT_SUBDIRS odbc-store" + + +fi + + + + +if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then + echo "==================================================================" + echo "WARNING: You have chosen to compile Apache-1.3 modules with a different" + echo " compiler than the one used to compile Apache." + echo "" + echo " Current compiler: $CC" + echo " Apache's compiler: $APXS_CC" + echo "" + echo "This could cause problems." + echo "==================================================================" +fi + +if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then + echo "==================================================================" + echo "WARNING: You have chosen to compile Apache-2.0 modules with a different" + echo " compiler than the one used to compile Apache." + echo "" + echo " Current compiler: $CC" + echo " Apache's compiler: $APXS2_CC" + echo "" + echo "This could cause problems." + echo "==================================================================" +fi + +if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then + echo "==================================================================" + echo "WARNING: You have chosen to compile Apache-2.2 modules with a different" + echo " compiler than the one used to compile Apache." + echo "" + echo " Current compiler: $CC" + echo " Apache's compiler: $APXS22_CC" + echo "" + echo "This could cause problems." + echo "==================================================================" +fi + +LIBTOOL="$LIBTOOL --silent" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${DX_COND_doc_TRUE}" && test -z "${DX_COND_doc_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_doc\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_doc\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_doc_TRUE}" && test -z "${DX_COND_doc_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_doc\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_doc\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_dot\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_dot\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_dot\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_dot\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_man\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_man\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_man\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_man\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_rtf\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_rtf\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_rtf\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_rtf\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_xml\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_xml\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_xml\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_xml\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_chm\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_chm\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_chm\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_chm\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_chi\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_chi\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_chi\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_chi\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_html\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_html\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_html\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_html\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_ps\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_ps\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_ps\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_ps\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_pdf\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_pdf\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_pdf\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_pdf\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_latex\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_latex\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"DX_COND_latex\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"DX_COND_latex\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${BUILD_NSAPI_TRUE}" && test -z "${BUILD_NSAPI_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_NSAPI\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_NSAPI\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${BUILD_FASTCGI_TRUE}" && test -z "${BUILD_FASTCGI_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_FASTCGI\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_FASTCGI\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${BUILD_AP13_TRUE}" && test -z "${BUILD_AP13_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_AP13\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_AP13\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${BUILD_AP20_TRUE}" && test -z "${BUILD_AP20_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_AP20\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_AP20\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${BUILD_AP22_TRUE}" && test -z "${BUILD_AP22_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_AP22\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_AP22\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by shibboleth $as_me 2.0, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +shibboleth config.status 2.0 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "schemas/Makefile" ) CONFIG_FILES="$CONFIG_FILES schemas/Makefile" ;; + "configs/Makefile" ) CONFIG_FILES="$CONFIG_FILES configs/Makefile" ;; + "shibsp/Makefile" ) CONFIG_FILES="$CONFIG_FILES shibsp/Makefile" ;; + "shibd/Makefile" ) CONFIG_FILES="$CONFIG_FILES shibd/Makefile" ;; + "util/Makefile" ) CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; + "selinux/Makefile" ) CONFIG_FILES="$CONFIG_FILES selinux/Makefile" ;; + "adfs/Makefile" ) CONFIG_FILES="$CONFIG_FILES adfs/Makefile" ;; + "nsapi_shib/Makefile" ) CONFIG_FILES="$CONFIG_FILES nsapi_shib/Makefile" ;; + "fastcgi/Makefile" ) CONFIG_FILES="$CONFIG_FILES fastcgi/Makefile" ;; + "apache/Makefile" ) CONFIG_FILES="$CONFIG_FILES apache/Makefile" ;; + "odbc-store/Makefile" ) CONFIG_FILES="$CONFIG_FILES odbc-store/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@DX_PROJECT@,$DX_PROJECT,;t t +s,@DX_CONFIG@,$DX_CONFIG,;t t +s,@DX_DOCDIR@,$DX_DOCDIR,;t t +s,@DX_ENV@,$DX_ENV,;t t +s,@DX_FLAG_doc@,$DX_FLAG_doc,;t t +s,@DX_DOXYGEN@,$DX_DOXYGEN,;t t +s,@ac_pt_DX_DOXYGEN@,$ac_pt_DX_DOXYGEN,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_PERL@,$DX_PERL,;t t +s,@ac_pt_DX_PERL@,$ac_pt_DX_PERL,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_doc_TRUE@,$DX_COND_doc_TRUE,;t t +s,@DX_COND_doc_FALSE@,$DX_COND_doc_FALSE,;t t +s,@DX_FLAG_dot@,$DX_FLAG_dot,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_DOT@,$DX_DOT,;t t +s,@ac_pt_DX_DOT@,$ac_pt_DX_DOT,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_dot_TRUE@,$DX_COND_dot_TRUE,;t t +s,@DX_COND_dot_FALSE@,$DX_COND_dot_FALSE,;t t +s,@DX_FLAG_man@,$DX_FLAG_man,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_man_TRUE@,$DX_COND_man_TRUE,;t t +s,@DX_COND_man_FALSE@,$DX_COND_man_FALSE,;t t +s,@DX_FLAG_rtf@,$DX_FLAG_rtf,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_rtf_TRUE@,$DX_COND_rtf_TRUE,;t t +s,@DX_COND_rtf_FALSE@,$DX_COND_rtf_FALSE,;t t +s,@DX_FLAG_xml@,$DX_FLAG_xml,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_xml_TRUE@,$DX_COND_xml_TRUE,;t t +s,@DX_COND_xml_FALSE@,$DX_COND_xml_FALSE,;t t +s,@DX_FLAG_chm@,$DX_FLAG_chm,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_HHC@,$DX_HHC,;t t +s,@ac_pt_DX_HHC@,$ac_pt_DX_HHC,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_chm_TRUE@,$DX_COND_chm_TRUE,;t t +s,@DX_COND_chm_FALSE@,$DX_COND_chm_FALSE,;t t +s,@DX_FLAG_chi@,$DX_FLAG_chi,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_chi_TRUE@,$DX_COND_chi_TRUE,;t t +s,@DX_COND_chi_FALSE@,$DX_COND_chi_FALSE,;t t +s,@DX_FLAG_html@,$DX_FLAG_html,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_html_TRUE@,$DX_COND_html_TRUE,;t t +s,@DX_COND_html_FALSE@,$DX_COND_html_FALSE,;t t +s,@DX_FLAG_ps@,$DX_FLAG_ps,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_LATEX@,$DX_LATEX,;t t +s,@ac_pt_DX_LATEX@,$ac_pt_DX_LATEX,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_MAKEINDEX@,$DX_MAKEINDEX,;t t +s,@ac_pt_DX_MAKEINDEX@,$ac_pt_DX_MAKEINDEX,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_DVIPS@,$DX_DVIPS,;t t +s,@ac_pt_DX_DVIPS@,$ac_pt_DX_DVIPS,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_EGREP@,$DX_EGREP,;t t +s,@ac_pt_DX_EGREP@,$ac_pt_DX_EGREP,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_ps_TRUE@,$DX_COND_ps_TRUE,;t t +s,@DX_COND_ps_FALSE@,$DX_COND_ps_FALSE,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_PDFLATEX@,$DX_PDFLATEX,;t t +s,@ac_pt_DX_PDFLATEX@,$ac_pt_DX_PDFLATEX,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_FLAG_pdf@,$DX_FLAG_pdf,;t t +s,@DX_COND_pdf_TRUE@,$DX_COND_pdf_TRUE,;t t +s,@DX_COND_pdf_FALSE@,$DX_COND_pdf_FALSE,;t t +s,@DX_COND_latex_TRUE@,$DX_COND_latex_TRUE,;t t +s,@DX_COND_latex_FALSE@,$DX_COND_latex_FALSE,;t t +s,@DOXYGEN_PAPER_SIZE@,$DOXYGEN_PAPER_SIZE,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXDEPMODE@,$CXXDEPMODE,;t t +s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t +s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@EGREP@,$EGREP,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CPP@,$CPP,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@acx_pthread_config@,$acx_pthread_config,;t t +s,@PTHREAD_CC@,$PTHREAD_CC,;t t +s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t +s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@LOG4SHIB_CONFIG@,$LOG4SHIB_CONFIG,;t t +s,@LOG4CPP_CONFIG@,$LOG4CPP_CONFIG,;t t +s,@XMLTOOLINGXMLDIR@,$XMLTOOLINGXMLDIR,;t t +s,@OPENSAMLXMLDIR@,$OPENSAMLXMLDIR,;t t +s,@LITE_LIBS@,$LITE_LIBS,;t t +s,@XMLSEC_LIBS@,$XMLSEC_LIBS,;t t +s,@NSAPI_INCLUDE@,$NSAPI_INCLUDE,;t t +s,@BUILD_NSAPI_TRUE@,$BUILD_NSAPI_TRUE,;t t +s,@BUILD_NSAPI_FALSE@,$BUILD_NSAPI_FALSE,;t t +s,@FASTCGI_INCLUDE@,$FASTCGI_INCLUDE,;t t +s,@FASTCGI_LDFLAGS@,$FASTCGI_LDFLAGS,;t t +s,@FASTCGI_LIBS@,$FASTCGI_LIBS,;t t +s,@BUILD_FASTCGI_TRUE@,$BUILD_FASTCGI_TRUE,;t t +s,@BUILD_FASTCGI_FALSE@,$BUILD_FASTCGI_FALSE,;t t +s,@xs@,$xs,;t t +s,@APXS@,$APXS,;t t +s,@APXS_CFLAGS@,$APXS_CFLAGS,;t t +s,@APXS_INCLUDE@,$APXS_INCLUDE,;t t +s,@APXS2@,$APXS2,;t t +s,@APR_CONFIG@,$APR_CONFIG,;t t +s,@APXS2_CFLAGS@,$APXS2_CFLAGS,;t t +s,@APXS2_INCLUDE@,$APXS2_INCLUDE,;t t +s,@APXS22@,$APXS22,;t t +s,@APR1_CONFIG@,$APR1_CONFIG,;t t +s,@APXS22_CFLAGS@,$APXS22_CFLAGS,;t t +s,@APXS22_INCLUDE@,$APXS22_INCLUDE,;t t +s,@BUILD_AP13_TRUE@,$BUILD_AP13_TRUE,;t t +s,@BUILD_AP13_FALSE@,$BUILD_AP13_FALSE,;t t +s,@BUILD_AP20_TRUE@,$BUILD_AP20_TRUE,;t t +s,@BUILD_AP20_FALSE@,$BUILD_AP20_FALSE,;t t +s,@BUILD_AP22_TRUE@,$BUILD_AP22_TRUE,;t t +s,@BUILD_AP22_FALSE@,$BUILD_AP22_FALSE,;t t +s,@ODBC_CONFIG@,$ODBC_CONFIG,;t t +s,@ODBC_CFLAGS@,$ODBC_CFLAGS,;t t +s,@ODBC_LIBS@,$ODBC_LIBS,;t t +s,@WANT_SUBDIRS@,$WANT_SUBDIRS,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..ef10e95 --- /dev/null +++ b/configure.ac @@ -0,0 +1,888 @@ +AC_PREREQ([2.50]) +AC_INIT([shibboleth], [2.0], [shibboleth-users@internet2.edu], [shibboleth]) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE([shibboleth],[2.0]) + +sinclude(doxygen.m4) +sinclude(acx_pthread.m4) + +# Docygen features +DX_HTML_FEATURE(ON) +DX_CHM_FEATURE(OFF) +DX_CHI_FEATURE(OFF) +DX_MAN_FEATURE(OFF) +DX_RTF_FEATURE(OFF) +DX_XML_FEATURE(OFF) +DX_PDF_FEATURE(OFF) +DX_PS_FEATURE(OFF) +DX_INIT_DOXYGEN(shibboleth, doxygen.cfg, doc/api) +DX_INCLUDE= + +AC_ARG_ENABLE(debug, + AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no) +]), + enable_debug=$enableval, enable_debug=no) + +if test "$enable_debug" = "yes" ; then + GCC_CFLAGS="$CFLAGS -g -D_DEBUG" + GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG" +else + GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG" + GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG" +fi + +AC_PROG_CC([gcc gcc3 cc]) +AC_PROG_CXX([g++ g++3 c++ CC]) +AC_CANONICAL_HOST + +if test "$GCC" = "yes" ; then +# AC_HAVE_GCC_VERSION(4,0,0,0, +# [ +# AC_DEFINE(GCC_HASCLASSVISIBILITY,1, +# [Define to enable class visibility control in gcc.]) +# GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" +# GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" +# ]) + 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 + *solaris*) + if test "$CXX" = "CC" ; then + CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp" + fi + ;; + esac +fi + +AC_DISABLE_STATIC +AC_PROG_LIBTOOL + +AC_LANG(C) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_STRUCT_TM + +# Checks for library functions. +AC_FUNC_STRFTIME +AC_FUNC_STRERROR_R +AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strtok_r strcasecmp]) + +# checks for pthreads +ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"]) +if test $enable_threads != "pthread"; then + AC_MSG_ERROR([unable to find pthreads, currently this is required]) +else + AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]) + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$PTHREAD_CFLAGS $CFLAGS" + CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS" +fi + +# Thank you Solaris, really. +AC_MSG_CHECKING(for ctime_r) + if test -z "$ac_cv_ctime_args"; then + AC_TRY_COMPILE( + [#include ], + [ + time_t clock; + char buf[26]; + ctime_r(&clock, buf); + ], ac_cv_ctime_args=2) + + AC_TRY_COMPILE( + [#include ], + [ + time_t clock; + char buf[26]; + ctime_r(&clock, buf, 26); + ], ac_cv_ctime_args=3) + fi + if test -z "$ac_cv_ctime_args"; then + AC_MSG_RESULT(no) + else + if test "$ac_cv_ctime_args" = 2; then + AC_DEFINE(HAVE_CTIME_R_2,1,[Define if ctime_r is present with 2 parameters.]) + elif test "$ac_cv_ctime_args" = 3; then + AC_DEFINE(HAVE_CTIME_R_3,1,[Define if ctime_r is present with 3 parameters.]) + fi + AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments]) + fi + +# OpenSSL settings +AC_ARG_WITH(openssl, + AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]), + [if test x_$with_openssl != x_/usr; then + SSLFLAGS="-I${with_openssl}/include" + fi]) + +if test "x$SSLFLAGS" = "x" ; then + AC_PATH_PROG(PKG_CONFIG, pkg-config) + if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then + if pkg-config openssl ; then + SSLFLAGS="`$PKG_CONFIG --cflags openssl`" + else + AC_MSG_ERROR([OpenSSL not supported by pkg-config, try --with-openssl instead]) + fi + fi +fi + +AC_MSG_CHECKING(for OpenSSL cflags) +AC_MSG_RESULT($SSLFLAGS) +CPPFLAGS="$SSLFLAGS $CPPFLAGS" + +AC_CHECK_HEADER([openssl/x509.h],, + AC_MSG_ERROR([unable to find openssl header files])) + +AC_LANG(C++) + +# C++ requirements +AC_CXX_REQUIRE_STL +AC_CXX_NAMESPACES + +# log4shib settings (favor this version over the log4cpp code) +AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config) +AC_ARG_WITH(log4shib, + AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]), + [ + LOG4SHIB_CONFIG="${with_log4shib}" + if ! test -f "${LOG4SHIB_CONFIG}" ; then + LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config" + fi + ]) +if test -f "${LOG4SHIB_CONFIG}"; then + LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS" + CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS" + AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files])) + AC_TRY_LINK( + [#include +#include ], + [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol], + [AC_DEFINE(SHIBSP_LOG4SHIB,1,[Define if log4shib library is used.])], + [AC_MSG_ERROR([unable to link with log4shib])]) +else + AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option]) + AC_MSG_WARN([will look for original log4cpp library]) + + # log4cpp settings + AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config) + AC_ARG_WITH(log4cpp, + AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]), + [ + LOG4CPP_CONFIG="${with_log4cpp}" + if ! test -f "${LOG4CPP_CONFIG}" ; then + LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config" + fi + ]) + if test -f "${LOG4CPP_CONFIG}"; then + AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe]) + LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS" + CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS" + AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files])) + AC_TRY_LINK( + [#include +#include ], + [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol], + [AC_DEFINE(SHIBSP_LOG4CPP,1,[Define if log4cpp library is used.])], + [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])]) + else + AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option]) + fi +fi + +# Xerces settings +AC_ARG_WITH(xerces, + AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]), + [if test x_$with_xerces != x_/usr; then + LDFLAGS="-L${with_xerces}/lib $LDFLAGS" + CPPFLAGS="-I${with_xerces}/include $CPPFLAGS" + fi]) +LIBS="-lxerces-c $LIBS" +AC_CHECK_HEADER([xercesc/dom/DOM.hpp],, + AC_MSG_ERROR([unable to find xerces header files])) +AC_MSG_CHECKING([Xerces version]) +AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM([#include ], +[#if _XERCES_VERSION != 20600 +int i = 0; +#else +#error cannot use version 2.6.0 +#endif])], + [AC_MSG_RESULT(OK)], + [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])]) +AC_TRY_LINK( + [#include ], + [xercesc::XMLPlatformUtils::Initialize()], + [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])], + [AC_MSG_ERROR([unable to link with Xerces])]) + + +#XML-Tooling settings +AC_ARG_WITH(xmltooling, + AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]), + [if test x_$with_xmltooling != x_/usr; then + LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS" + CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS" + fi]) +LITE_LIBS="-lxmltooling-lite" +XMLSEC_LIBS="-lxmltooling" +AC_CHECK_HEADER([xmltooling/base.h],, + AC_MSG_ERROR([unable to find xmltooling header files])) + +# Establish location of xmltooling catalog. +XMLTOOLINGXMLDIR="" +if test "x$with_xmltooling" = "x" ; then + with_xmltooling="/usr" +fi +if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then + XMLTOOLINGXMLDIR="$with_xmltooling" +elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then + XMLTOOLINGXMLDIR="$with_xerces" +elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then + XMLTOOLINGXMLDIR="$with_log4shib" +fi +if test "x$XMLTOOLINGXMLDIR" = "x" ; then + AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option]) +fi +XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling" +AC_SUBST(XMLTOOLINGXMLDIR) + +# XML-Security settings +AC_ARG_WITH(xmlsec, + AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),, + [with_xmlsec=/usr]) + +if test x_$with_xmlsec != x_/usr; then + LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS" + CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS" +fi +XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS" + +# save and append master libs +save_LIBS="$LIBS" +LIBS="$XMLSEC_LIBS $LIBS" + +AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files])) +AC_MSG_CHECKING([XML-Security version]) +AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM([#include ], + [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3) +int i = 0; +#else +#error need version 1.4.0 or later +#endif])], + [AC_MSG_RESULT(OK)], + [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])]) +AC_TRY_LINK( + [#include ], + [XSECPlatformUtils::Initialise()],, + [AC_MSG_ERROR([unable to link with XML-Security])]) + +# restore master libs +LIBS="$save_LIBS" + +# OpenSAML settings +AC_ARG_WITH(saml, + AC_HELP_STRING([--with-saml=PATH], [where saml is installed]), + [if test x_$with_saml != x_/usr; then + LDFLAGS="-L${with_saml}/lib $LDFLAGS" + CPPFLAGS="-I${with_saml}/include $CPPFLAGS" + fi]) +XMLSEC_LIBS="-lsaml $XMLSEC_LIBS" + +# save and append master libs +save_LIBS="$LIBS" +LIBS="$XMLSEC_LIBS $LIBS" + +AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],, + AC_MSG_ERROR([unable to find OpenSAML header files])) +AC_TRY_LINK( + [#include +#include ], + [#if _OPENSAML_VERSION >= 20000 +opensaml::SAMLConfig::getConfig(); +#else +#error Need OpenSAML version 2.0 or higher +#endif], + [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])], + [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])]) + +# restore master libs +LIBS="$save_LIBS" + +# Establish location of opensaml catalogs. +OPENSAMLXMLDIR="" +if test "x$with_saml" = "x" ; then + with_saml="/usr" +fi +if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_saml" +elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_xmltooling" +elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_xerces" +elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then + OPENSAMLXMLDIR="$with_log4shib" +fi +if test "x$OPENSAMLXMLDIR" = "x" ; then + AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option]) +fi +OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml" +AC_SUBST(OPENSAMLXMLDIR) + +AC_SUBST(LITE_LIBS) +AC_SUBST(XMLSEC_LIBS) + +# output the underlying makefiles +WANT_SUBDIRS="doc schemas configs shibsp shibd util" +AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \ + configs/Makefile shibsp/Makefile shibd/Makefile \ + util/Makefile selinux/Makefile]) + +## ADFS? +AC_CONFIG_FILES([adfs/Makefile]) +AC_ARG_ENABLE([adfs], + AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]), + [adfs_enabled=$enableval], [adfs_enabled=yes]) +if test "x$adfs_enabled" = "x" ; then + adfs_enabled=yes +fi +AC_MSG_CHECKING(whether to build the ADFS module) +if test "$adfs_enabled" = "no" ; then + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) + WANT_SUBDIRS="$WANT_SUBDIRS adfs" +fi + + +# +# Build NSAPI module? +# +AC_MSG_CHECKING(for NSAPI module option) +AC_ARG_WITH(nsapi, + AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]), + [WANT_NSAPI=$withval],[WANT_NSAPI=no]) +AC_MSG_RESULT($WANT_NSAPI) + +if test "$WANT_NSAPI" != "no"; then + if test ! -d $WANT_NSAPI/bin ; then + AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR) + fi + AC_MSG_CHECKING(for NSAPI include files) + if test -d $WANT_NSAPI/include ; then + NSAPI_INCLUDE=$WANT_NSAPI/include + AC_MSG_RESULT(Netscape-Enterprise 3.x style) + AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX]) + NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE" + fi + if test -d $WANT_NSAPI/plugins/include ; then + test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE" + NSAPI_INCLUDE="$WANT_NSAPI/plugins/include" + AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style) + AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX]) + NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE" + fi + if test "$NSAPI_INCLUDE" = ""; then + AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include) + fi +fi + +AC_SUBST(NSAPI_INCLUDE) + +# always output the Makefile, even if you don't use it +AC_CONFIG_FILES([nsapi_shib/Makefile]) +AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no") + +# add the NSAPI module to the list of wanted subdirs.. +if test ! "$WANT_NSAPI" = "no" ; then + WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib" +fi + + +# +# Build FastCGI support? +# +AC_MSG_CHECKING(for FastCGI support) +AC_ARG_WITH(fastcgi, + AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]), + [WANT_FASTCGI=$withval],[WANT_FASTCGI=no]) +AC_MSG_RESULT($WANT_FASTCGI) + +if test "$WANT_FASTCGI" != "no"; then + if test "$WANT_FASTCGI" != "yes"; then + if test x_$WANT_FASTCGI != x_/usr; then + FASTCGI_INCLUDE="-I$WANT_FASTCGI/include" + FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib" + fi + fi + AC_CHECK_HEADER([fcgio.h],, + AC_MSG_ERROR([unable to find FastCGI header files])) + FASTCGI_LIBS="-lfcgi -lfcgi++" +fi + +AC_SUBST(FASTCGI_INCLUDE) +AC_SUBST(FASTCGI_LDFLAGS) +AC_SUBST(FASTCGI_LIBS) + +# always output the Makefile, even if you don't use it +AC_CONFIG_FILES([fastcgi/Makefile]) +AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no") + +if test ! "$WANT_FASTCGI" = "no" ; then + WANT_SUBDIRS="$WANT_SUBDIRS fastcgi" +fi + + +# +# If no --enable-apache-xx specified +# find a default and fake the specific parameters +# + +# simple macro to peek at an enable or a with +AC_DEFUN([Peek], +if test "[${[$1]_][$2]+set}" = set; then + peekval="${[$1]_[$2]}" + $3 +fi; dnl +) + +AC_MSG_CHECKING(if default apache needed) +need_default=yes +Peek(enable,apache_13,need_default=no) +Peek(enable,apache_20,need_default=no) +Peek(enable,apache_22,need_default=no) +AC_MSG_RESULT($need_default) + +if test "$need_default" = "yes"; then + # find an apxs, then the httpd + xs= + Peek(with,apxs,xs="$peekval") + Peek(with,apxs2,xs="$peekval") + Peek(with,apxs22,xs="$peekval") + if test "x$xs" = "x"; then + AC_PATH_PROGS(xs, apxs2 apxs, + AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs), + [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH]) + fi + # ask the daemon for the version and set parameters + AC_MSG_CHECKING(default apache version) + httpd="`$xs -q SBINDIR`/`$xs -q TARGET`" + if test "x$httpd" != "x" && test -f $httpd ; then + v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'` + case $v in + 1.3*) [enable_apache_13]=yes + [with_apxs]=$xs + AC_MSG_RESULT(1.3) + ;; + 2.0*) [enable_apache_20]=yes + [with_apxs2]=$xs + AC_MSG_RESULT(2.0) + ;; + 2.2*) [enable_apache_22]=yes + [with_apxs22]=$xs + AC_MSG_RESULT(2.2) + ;; + *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs) + esac + else + AC_MSG_RESULT(cannot determine version. Try setting --with-apxs) + fi +fi + +# Apache 1.3 (mod_shib_13) +# --enable-apache-13 +# --with-apxs (DSO build, the normal way, uses apxs to derive build flags) + +AC_ARG_ENABLE(apache-13, + AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]), + [ if test "x$enableval" = "x" ; then + WANT_APACHE_13=yes + else + WANT_APACHE_13="$enableval" + fi + ],[ WANT_APACHE_13=no ]) +AC_MSG_CHECKING(whether to build Apache 1.3 module) +if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then + WANT_APACHE_13=yes +fi +AC_MSG_RESULT($WANT_APACHE_13) + +if test "$WANT_APACHE_13" = "yes" ; then + AC_ARG_WITH(apxs, + AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]), + [ + AC_MSG_CHECKING(for user-specified apxs name/location) + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APXS=$withval + AC_MSG_RESULT("$withval") + fi + fi + ], + [ + AC_PATH_PROG(APXS, apxs, no) + if test "$APXS" = "no" ; then + for i in /usr/sbin /usr/local/apache/bin ; do + if test "$APXS" = "no" && test -f "$i/apxs"; then + APXS="$i/apxs" + fi + done + fi + ]) + + AC_MSG_CHECKING([to see if apxs was located]) + if test ! -f "$APXS" ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([Unable to locate apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs option.]) + fi + AC_MSG_RESULT($APXS) + AC_SUBST(APXS) + + # extract settings we need from APXS -q + APXS_CC="`$APXS -q CC`" + APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`" + APXS_INCLUDE="`$APXS -q INCLUDEDIR`" +fi + +AC_SUBST(APXS_CFLAGS) +AC_SUBST(APXS_INCLUDE) + + +# Apache 2.0 (mod_shib_20) +# --enable-apache-20 +# --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags) +# --with-apr (DSO build, APR development package installed separately) + +AC_ARG_ENABLE(apache-20, + AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]), + [ if test "x$enableval" = "x" ; then + WANT_APACHE_20=yes + else + WANT_APACHE_20="$enableval" + fi + ],[ WANT_APACHE_20=no ]) +AC_MSG_CHECKING(whether to build Apache 2.0 module) +if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then + WANT_APACHE_20=yes +fi +AC_MSG_RESULT($WANT_APACHE_20) + +if test "$WANT_APACHE_20" = "yes" ; then + AC_ARG_WITH(apxs2, + AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]), + [ + AC_MSG_CHECKING(for user-specified Apache2 apxs name/location) + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APXS2=$withval + AC_MSG_RESULT("$withval") + fi + fi + ], + [ + AC_PATH_PROG(APXS2, apxs2, no) + if test "$APXS2" = "no" ; then + AC_PATH_PROG(APXS2, apxs, no) + fi + if test "$APXS2" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS2" = "no" && test -f "$i/apxs2" ; then + APXS2="$i/apxs2" + fi + done + if test "$APXS2" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS2" = "no" && test -f "$i/apxs" ; then + APXS2="$i/apxs" + fi + done + fi + fi + ]) + + AC_MSG_CHECKING([to see if Apache2 apxs was located]) + if test ! -f "$APXS2" ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([Unable to locate Apache2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs2 option.]) + fi + AC_MSG_RESULT($APXS2) + AC_SUBST(APXS2) + + # APR settings + AC_ARG_WITH(apr, + AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]), + [ + AC_MSG_CHECKING(for user-specified apr-config name/location) + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APR_CONFIG=$withval + AC_MSG_RESULT("$withval") + fi + fi + ], + [ + AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH]) + ]) + if test -f "${APR_CONFIG}"; then + APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`" + else + AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.]) + fi + + # extract settings we need from APXS2 -q + APXS2_CC="`$APXS2 -q CC`" + APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS" + APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`" +fi + +AC_SUBST(APXS2_CFLAGS) +AC_SUBST(APXS2_INCLUDE) + + +# Apache 2.2 (mod_shib_22) +# --enable-apache-22 +# --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags) +# --with-apr1 (DSO build, APR development package installed separately) + +AC_ARG_ENABLE(apache-22, + AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]), + [ if test "x$enableval" = "x" ; then + WANT_APACHE_22=yes + else + WANT_APACHE_22="$enableval" + fi + ],[ WANT_APACHE_22=no ]) +AC_MSG_CHECKING(whether to build Apache 2.2 module) +if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then + WANT_APACHE_22=yes +fi +AC_MSG_RESULT($WANT_APACHE_22) + +if test "$WANT_APACHE_22" = "yes" ; then + AC_ARG_WITH(apxs22, + AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]), + [ + AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location) + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APXS22=$withval + AC_MSG_RESULT("$withval") + fi + fi + ], + [ + AC_PATH_PROG(APXS22, apxs2, no) + if test "$APXS22" = "no" ; then + AC_PATH_PROG(APXS22, apxs, no) + fi + if test "$APXS22" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS22" = "no" && test -f "$i/apxs2" ; then + APXS22="$i/apxs2" + fi + done + if test "$APXS22" = "no" ; then + for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do + if test "$APXS22" = "no" && test -f "$i/apxs" ; then + APXS22="$i/apxs" + fi + done + fi + fi + ]) + + AC_MSG_CHECKING([to see if Apache2.2 apxs was located]) + if test ! -f "$APXS22" ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([Unable to locate Apache2.2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs22 option.]) + fi + AC_MSG_RESULT($APXS22) + AC_SUBST(APXS22) + + # APR1 settings + AC_ARG_WITH(apr1, + AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]), + [ + AC_MSG_CHECKING(for user-specified apr-1-config name/location) + if test "$withval" != "no" ; then + if test "$withval" != "yes"; then + APR1_CONFIG=$withval + AC_MSG_RESULT("$withval") + fi + fi + ], + [ + AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH]) + ]) + if test -f "${APR1_CONFIG}"; then + APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`" + else + AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.]) + fi + + # extract settings we need from APXS22 -q + APXS22_CC="`$APXS22 -q CC`" + APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS" + APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`" +fi + +AC_SUBST(APXS22_CFLAGS) +AC_SUBST(APXS22_INCLUDE) + +# always output the Makefile, even if you don't use it +AC_CONFIG_FILES([apache/Makefile]) +AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes") +AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes") +AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes") + +# add the apache module to the list of wanted subdirs.. +if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then + WANT_SUBDIRS="$WANT_SUBDIRS apache" +fi + + +# +# Implement the checks of the ODBC Storage Service +# +# 1) Assume the user wants ODBC; if it's not found then just continue without +# 2) If the user specifically requested odbc, look for it and ERROR if not found +# 3) If the user specifically requested no odbc, don't build it. +# + +AC_CONFIG_FILES([odbc-store/Makefile]) + +# determine whether we should enable the odbc ccache +AC_ARG_ENABLE([odbc], + AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]), + [odbc_enabled=$enableval], [odbc_enabled=default]) + +if test "x$odbc_enabled" = "x" ; then + odbc_enabled=yes +fi + +# Are we trying to build ODBC? +AC_MSG_CHECKING(whether to build the ODBC storage service) +if test "$odbc_enabled" = "yes" ; then + build_odbc=yes + AC_MSG_RESULT(yes) +elif test "$odbc_enabled" = "default" ; then + build_odbc=yes + AC_MSG_RESULT([yes, if it can be found]) +else + build_odbc=no + AC_MSG_RESULT(no) +fi + +# If we're trying to build ODBC, try to find the odbc_config program. +if test "$build_odbc" = "yes" ; then + odbc_dir="" + AC_ARG_WITH(odbc, + AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]), + [if test "$with_odbc" = no ; then + AC_MSG_ERROR([Try running --disable-odbc instead.]) + elif test "$with_odbc" != yes ; then + odbc_dir="$with_odbc/bin" + if test "$with_odbc" != /usr ; then + ODBC_CFLAGS="-I$with_odbc/include" + ODBC_LIBS="-L$with_odbc/lib" + fi + fi ]) + + AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH ) + if test "$ODBC_CONFIG" = no ; then + AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.]) + ODBC_LIBS="$ODBC_LIBS -lodbc" + else + ODBC_CFLAGS=`$ODBC_CONFIG --cflags` + ODBC_LIBS=`$ODBC_CONFIG --libs` + fi + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS" + + AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no]) + if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then + AC_MSG_ERROR(unable to find ODBC header files) + fi + + if test "$have_sql_h" = yes ; then + save_LIBS="$LIBS" + LIBS="$LIBS $ODBC_LIBS" + AC_MSG_CHECKING(if we can link againt ODBC) + AC_TRY_LINK( + [#include + #include + #include ], + [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)], + [have_odbc_libs=yes], + [have_odbc_libs=no]) + LIBS="$save_LIBS" + + if test "$have_odbc_libs" = no ; then + if test "$odbc_enabled" = "yes" ; then + AC_MSG_ERROR([unable to link with ODBC Library]) + else + AC_MSG_RESULT(no, skipping ODBC) + fi + fi + fi + + CPPFLAGS="$save_CPPFLAGS" +fi + +# if have_odbc_libs=yes then go ahead with building ODBC +if test "$have_odbc_libs" = yes ; then + # this AC_MSG_RESULT is from above! + AC_MSG_RESULT(yes) + WANT_SUBDIRS="$WANT_SUBDIRS odbc-store" + AC_SUBST(ODBC_CFLAGS) + AC_SUBST(ODBC_LIBS) +fi + + +AC_SUBST(WANT_SUBDIRS) + +if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then + echo "==================================================================" + echo "WARNING: You have chosen to compile Apache-1.3 modules with a different" + echo " compiler than the one used to compile Apache." + echo "" + echo " Current compiler: $CC" + echo " Apache's compiler: $APXS_CC" + echo "" + echo "This could cause problems." + echo "==================================================================" +fi + +if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then + echo "==================================================================" + echo "WARNING: You have chosen to compile Apache-2.0 modules with a different" + echo " compiler than the one used to compile Apache." + echo "" + echo " Current compiler: $CC" + echo " Apache's compiler: $APXS2_CC" + echo "" + echo "This could cause problems." + echo "==================================================================" +fi + +if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then + echo "==================================================================" + echo "WARNING: You have chosen to compile Apache-2.2 modules with a different" + echo " compiler than the one used to compile Apache." + echo "" + echo " Current compiler: $CC" + echo " Apache's compiler: $APXS22_CC" + echo "" + echo "This could cause problems." + echo "==================================================================" +fi + +LIBTOOL="$LIBTOOL --silent" + +AC_OUTPUT + diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..edb5d38 --- /dev/null +++ b/depcomp @@ -0,0 +1,479 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" +fi + +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + tmpdepfile1="$dir.libs/$base.lo.d" + tmpdepfile2="$dir.libs/$base.d" + "$@" -Wc,-MD + else + tmpdepfile1="$dir$base.o.d" + tmpdepfile2="$dir$base.d" + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/depend b/depend new file mode 100644 index 0000000..1e7190a --- /dev/null +++ b/depend @@ -0,0 +1,12 @@ +P SHIBossl OpenSSL + 0.9.8g +P SHIBxerces xerces-c + 2.8.0 +P SHIBxmlsec xml-security-c + 1.4.0 +P SHIBxmltool xmltooling-c + 1.0 +P SHIBosaml opensaml-c + 2.0 +P SHIBlog4shib log4shib + 1.0 diff --git a/doc/CREDITS.txt b/doc/CREDITS.txt new file mode 100755 index 0000000..5b72040 --- /dev/null +++ b/doc/CREDITS.txt @@ -0,0 +1,89 @@ +Shibboleth Implementation Team + + Documentation + + Nate Klingenstein + Internet2 + ndk@internet2.edu + + Design and Programming + + Derek Atkins + IHTFP Consulting, Inc + derek@ihtfp.com + + Scott Cantor + The Ohio State University + cantor.2@osu.edu + + Jim Fox + University of Washington + fox@washington.edu + + Walter Hoehn + The University of Memphis + wassa@memphis.edu + + Chad LaJoie + Georgetown University + lajoie@georgetown.edu + + Derek Morr + Penn State University + dvm105@psu.edu + + Will Norris + USC + wnorris@usc.edu + + Brent Putman + Georgetown University + putmanb@georgetown.edu + + Rod Widdowson + Steading Software, Inc. + rdw@steadingsoftware.com + + Project Management + + RL "Bob" Morgan + University of Washington + rlmorgan@washington.edu + + Steven Carmody + Brown University + Steven_Carmody@brown.edu + + Ken Klingenstein + Internet2 + kjk@internet2.edu + + +Thanks to: + + Internet2 + + The National Science Foundation + + National Research Council of Canada + + Barbara Jenson (CMU), Parviz Dousti (CMU), Tom Dopirak (CMU), + and Sridhar Muppidi (IBM/Tivoli); for helping to develop + the initial shibboleth prototype + + Brian Pittman (WebAssign), Mark Earnest (PSU), James Shvarts (Columbia), + Ryan Muldoon (Wisconsin), John Hopkins (PSU), Noah Levitt (Columbia), + and David Walker (UCOP); for much help with testing + + Dave Dearman (NRCC), for contributing a SQL Data Connector for the AA + resolver + + Noah Levitt (Columbia), for simplifying the logging configuration. + + Joel Murphy (Buffalo), for much help with load testing and generally + pushing the software to its limits. + + Vishal Goenka (SunGard SCT) for contributing some useful resolver plugins + + Ian Young for donating XSLT scripts for converting metadata across + Shibboleth versions \ No newline at end of file diff --git a/doc/FASTCGI.LICENSE b/doc/FASTCGI.LICENSE new file mode 100644 index 0000000..55dde7c --- /dev/null +++ b/doc/FASTCGI.LICENSE @@ -0,0 +1,28 @@ +This FastCGI application library source and object code (the +"Software") and its documentation (the "Documentation") are +copyrighted by Open Market, Inc ("Open Market"). The following terms +apply to all files associated with the Software and Documentation +unless explicitly disclaimed in individual files. + +Open Market permits you to use, copy, modify, distribute, and license +this Software and the Documentation for any purpose, provided that +existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written +agreement, license, or royalty fee is required for any of the +authorized uses. Modifications to this Software and Documentation may +be copyrighted by their authors and need not follow the licensing +terms described here. If modifications to this Software and +Documentation have new licensing terms, the new terms must be clearly +indicated on the first page of each file where they apply. + +OPEN MARKET MAKES NO EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE +SOFTWARE OR THE DOCUMENTATION, INCLUDING WITHOUT LIMITATION ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN +NO EVENT SHALL OPEN MARKET BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY +DAMAGES ARISING FROM OR RELATING TO THIS SOFTWARE OR THE +DOCUMENTATION, INCLUDING, WITHOUT LIMITATION, ANY INDIRECT, SPECIAL OR +CONSEQUENTIAL DAMAGES OR SIMILAR DAMAGES, INCLUDING LOST PROFITS OR +LOST DATA, EVEN IF OPEN MARKET HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS". +OPEN MARKET HAS NO LIABILITY IN CONTRACT, TORT, NEGLIGENCE OR +OTHERWISE ARISING OUT OF THIS SOFTWARE OR THE DOCUMENTATION. diff --git a/doc/LICENSE.txt b/doc/LICENSE.txt new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/doc/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/doc/LOG4CPP.LICENSE b/doc/LOG4CPP.LICENSE new file mode 100644 index 0000000..cbee875 --- /dev/null +++ b/doc/LOG4CPP.LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..3b312ee --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,19 @@ +AUTOMAKE_OPTIONS = foreign + +pkgdocdir = $(datadir)/doc/@PACKAGE@ + +docfiles = \ + CREDITS.txt \ + LICENSE.txt \ + NOTICE.txt \ + README.txt \ + RELEASE.txt \ + FASTCGI.LICENSE \ + OPENSSL.LICENSE \ + LOG4CPP.LICENSE \ + main.css \ + logo.jpg + +pkgdoc_DATA = $(docfiles) + +EXTRA_DIST = $(docfiles) api diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..7cf7828 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,452 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgdocdir)" +pkgdocDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgdoc_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +pkgdocdir = $(datadir)/doc/@PACKAGE@ +docfiles = \ + CREDITS.txt \ + LICENSE.txt \ + NOTICE.txt \ + README.txt \ + RELEASE.txt \ + FASTCGI.LICENSE \ + OPENSSL.LICENSE \ + LOG4CPP.LICENSE \ + main.css \ + logo.jpg + +pkgdoc_DATA = $(docfiles) +EXTRA_DIST = $(docfiles) api +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-pkgdocDATA: $(pkgdoc_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgdocdir)" || $(mkdir_p) "$(DESTDIR)$(pkgdocdir)" + @list='$(pkgdoc_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgdocDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdocdir)/$$f'"; \ + $(pkgdocDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdocdir)/$$f"; \ + done + +uninstall-pkgdocDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgdoc_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgdocdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgdocdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkgdocdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgdocDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkgdocDATA + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-pkgdocDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-info-am uninstall-pkgdocDATA + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/NOTICE.txt b/doc/NOTICE.txt new file mode 100644 index 0000000..8fe5fa7 --- /dev/null +++ b/doc/NOTICE.txt @@ -0,0 +1,14 @@ +We wish to acknowledge the following copyrighted works that make up +portions of this software: + +This product includes software developed by the Apache Software +Foundation (http://www.apache.org/). + +This product includes software developed by the OpenSSL Project +for use in the OpenSSL Toolkit. (http://www.openssl.org/). + +This project uses libraries covered by the Lesser GNU Public License. +Source code for these libraries is available on request. + +This project includes software developed by the National Research Council +of Canada. diff --git a/doc/OPENSSL.LICENSE b/doc/OPENSSL.LICENSE new file mode 100644 index 0000000..cdc9ade --- /dev/null +++ b/doc/OPENSSL.LICENSE @@ -0,0 +1,127 @@ + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + diff --git a/doc/README.txt b/doc/README.txt new file mode 100644 index 0000000..620c3ad --- /dev/null +++ b/doc/README.txt @@ -0,0 +1,28 @@ +March 17, 2008 +Version 2.0 + +Welcome to Internet2's Shibboleth + +Shibboleth is a federated web authentication and attribute exchange system +based on SAML developed by Internet2 and MACE. + +Please review the terms described in the LICENSE.txt file before using this +code. It is now the Apache 2.0 license. + +A wealth of information about Shibboleth can be found at +http://shibboleth.internet2.edu/ + +Shibboleth is divided into identity and service provider components, with the +IdP in Java and the SP in C and C++. + +Source and binary distributions are available from +http://shibboleth.internet2.edu/downloads/ + +SVN is available for anonymous access, as described at the Shibboleth +site. Mailing lists and a bug database (https://bugs.internet2.edu/) are also +available. Not all of the lists are open, but a general support list is +available and is open. + +For basic information on installing binaries and deploying Shibboleth, refer +to the web site and Wiki for the latest documentation. For source build assistance, +see the INSTALL.txt file and the Wiki. diff --git a/doc/RELEASE.txt b/doc/RELEASE.txt new file mode 100644 index 0000000..4c1370a --- /dev/null +++ b/doc/RELEASE.txt @@ -0,0 +1,114 @@ +Release Notes + +Shibboleth Native SP +2.0 +3/17/2008 + +NOTE: The shibboleth2.xml configuration format in this release +is compatible with the RC1 release. Upgrading from earlier +releases is NOT supported without replacing the configuration +file and reapplying changes. + +Fully Supported + +- SAML 1.0, 1.1, 2.0 Single Sign-On + - Shibboleth 1.x request profile + - 1.x POST/Artifact profiles + - 2.0 HTTP-Redirect/POST/POST-SimpleSign/Artifact/PAOS bindings + +- SAML 1.0, 1.1, 2.0 Attribute Query via Attribute Resolver plugin + - SAML SOAP binding + +- SAML 2.0 Single Logout + - HTTP-Redirect/POST/POST-SimpleSign/Artifact bindings + - Front and back-channel application notification of logout + - Race detection of late arriving assertions + +- SAML 2.0 NameID Management (IdP-initiated only) + - HTTP-Redirect/POST/POST-SimpleSign/Artifact bindings + - Front and back-channel application notification of changes + +- ADFS WS-Federation Support + - SSO and SLO + - experimental support for SAML 2.0 assertions + +- Shibboleth WAYF and SAML DS protocols for IdP Discovery + +- Metadata Providers + - Bulk resolution via local file, or URL with local file backup + - Dynamic resolution and caching based on entityID + - Filtering based on whitelist, blacklist, or signature verification + +- Metadata Generation Handler + - Generates and optionally signs SAML metadata based on SP configuration + +- Status Handler + - Reports on status and configuration of SP + +- Session Handler + - Dumps information about an active session + +- Trust Engines + - Explicit key and PKIX engines via metadata, superset compatible with 1.3 + - PKIX trust engine with static root list + +- Configurable per-endpoint Security Policy rules + - Replay and freshness detection + - XML signing + - Simple "blob" signing + - TLS X.509 certificate authentication + +- Client transport authentication to SOAP endpoints via libcurl + - TLS X.509 client certificates + - Basic-Auth + - Digest-Auth (untested) + - NTLM (untested) + +- Encryption + - All incoming SAML 2 encrypted element types (Assertion, NameID, Attribute) + - Optional outgoing encryption of NameID in requests and responses + +- Attributes + - Decoding and exporting SAML 1 and 2 attributes + - Strings + - Value/scope pairs (legacy and value@scope syntaxes supported) + - NameIDs + +- Attribute Filtering + - Policy language compatible with IdP filtering, except that references + only work within policy files, not across them + - Rules based on, attribute issuer, requester, scope, and value, authentication + method, based on exact string and regular expressions. + - Boolean functions supporting AND, OR, and NOT for use in composing rules + - Wildcard rules allowing all unspecified attributes through with no filtering + +- Assertion Export + - Oversized header replaced with Shib-Assertion-Count and Shib-Assertion-NN headers + containing local URL to fetch SAML assertion using HTTP GET + +- Enhanced Spoofing Detection + - Detects and blocks client headers that would match known attribute headers + - Does not support Apache mod_rewrite, but can be disabled when necessary + +- ODBC Clustering Support + - Tested against a few different servers with various drivers + +- RequestMap enhancements + - Regular expression matching for hosts and paths + - Query string parameter matching + +- Error handling enhancements + - Reporting of SAML status errors + - Optional redirection to custom error handler + +- Apache module enhancements + - "OR" coexistence with other authorization modules + - htaccess-based override of any valid RequestMap property + +- Command line tools + - samlsign for manual XML signing and verification + - mdquery for interrogating via metadata configuration + - resolvertest for exercising attribute extraction, filtering, and resolution + +- Migrating 1.3 core configuration file + - Stylesheet can handle some common options diff --git a/doc/logo.jpg b/doc/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c021e7feb192c8fc4b1255ae5de7d537a99a2b12 GIT binary patch literal 13660 zcma*Nb9`i7(=OZ{&cwDevF&7%Ol)i7iEUdGCllMYZBC4iZQDM%pXdGFbD#gd)!4nN zYFAxVyVmMm_1hndADaLqNl^(=01ylS`1Sb$e4GN1e>fRhxB-9w2mk=U`$;+nkPH5@ zF)#xB>i(nv!2#$H;7~B|004Xs0Dy4~0FaIX0Bo8cD}X=%6a)kWBm@*BB-B@^&kyVu zD5x*6a4;~iFfedPaQ_)da0rMj{w(Wg7$z|ZmN!2b*gNGNDLDxfTVBdN5YIMADdGnq-akHNpv}Fz=GD}Un{KiZR_e!?lwBg zrxhSL7$gMv{~$mHAOVSq80DGtQ3Mt2z(~I9`7wWvX_KY<*F#2y2fI2)G$mwes-qyL`+FrC@fK6blowUWb7SB}NZ z2U_sBXb@bjL&+uU`@iKTa`vpie~t6Mu0-+tb%$+6XL1=RN+Fnm)~*KqOAY{qQ{
EO2S%nRP2JN?$+yltU(mUh6iN3Q50>96 z9H1Bftr5F7Br%Jgf61N0u)INLmXy@0aGN3x_PL@`=ig#Ld40EV?AE%sqm7;T)~{Eu z*Y`T*n=+wYjU@{&n>T&56(S24wARMmW#KF`7V=ctlW!ioSl6tL4J3(>fooU$!%+b2 z(lRTu0<{fKuvXTxugG;y&aE`uUF+(;(AXs@7hrNlY4pU4ZhJ{l?ncKGq}c6hMIr_?wf*x^U55V>q%~nX306N zoT`+JYR~)mq3oSj9J= zes^603PHvdtIcJfap!S3y6{x^S0?Y5gM+br%Q+PU>zRkF{;69Yo^>B&!RcFsxTMdZ z2q5t~w6170vQ6a~nY{ILJO=T>SuuHFh3!V)40pC`sHl&e3=m$Io1=VxJfGs9EM0q-7p$ z4VGS5mA4Rdkd%^VEG>`f^0IW*mKOyGsMtxx6}B~`d{Gk2`i%X9>Fp$zJIBCmo0^?e zT3O@k(^>x_dX2HpqUt_%<+rn0A43f}7@tW3b<3G$ka20nxry4sV1kE{M$Fu)E?@C{ zdw89iNnz8VEWI;<2fKBruF@_3KoRsb^S_fF7&4uq%QCa!ls?h6`W-ysuwhiJ;oRX# z+galKRLi5IH`x@>wXqFqu8-B{BGf{Bz9sO7ZH=C^t zJr_Q>C8T9#YLvCLpn7Q`9|gWF&BupyJVR#&=KBjQs_4z)YLB*73(%4+O;hEL`OL*$ z$1tqDs{AY66G3t6zyi5ytA45!xgzRfnP_LVC{;m?`i{x8g8rf##)S7^XGElw$SO4U zN(&l>hk_Z&n|qFd2MpzLpzWxEhixAklN;t@-8(HNP6MU&-;I>f%sb8ddt8kx<;)Ut zD!qW?8jiy!f_3`y+Q^+~b+z4odu?*$DDrAl^;+&xgR^o!@1U?hrVo7{5r5$HJhYez zPpt+NTiKxoXH1K>YMZ_RB|&kjWp#-fkGdUX_C;KB(82Q)>P0rz%o`QRb$b<-dttVo z(Sc-1DyA;J(C91aPZ~m=^IzkhX|8bjD<5@on-D$#6-At>KjsW^Il3yn+VxZ#V@F)} zgE>!R&>EcQ2CK#1;JnA(NL>bs2Y)j53X7h?N@Vs;C1X>fTRDJ{g)74Z7hLuwi5r`tLC z!hyQ?#ja2PNnSk=Pu&b71PsvawdUvuW+L)*5_@?j@4t%wdRqxbYxMAdho?iAwF32` zZ-Y+m-9t-HmSy#yr*1A(Qnw7)E9(8wWimpF#4X@6j6x|?*%E(c8LCPFCCg*x;bk(- zgspdkHLoxRy0*0OJr}qU-1{J0!YS*}I z+jYP<#TWKABNrty{0iKP-htA)0Hb><%X$N2cNt2H+-sTO+JeotyR|@u_r%^(zOz|{ zA+{9iHxqsCyvia`0gAdui_iV=&j;W?tNinh0}|}YWCUxCH)=Fv3N70*8lQBJA7wzdBY6oTNYaa+2c3%YE<1g@radE{?oW7FB4v3Je zQ@D7ejE>~d8(*fMPi|6)G~=C5tW$06yOd`#?L>=i0e2#^%qLd4_>7Ke;QT#HBvODZ z5jG(n)Lh94S+;5Mnj*q@&4pz zxvdSY>n5a)upa<2?-R?9jujm18;c#@du1Pn*2<3Nm%l97M8+y)LIFpU_i|~`)>OX= z8BiOdsAR~1XbX>l#%8#XLsX;9r;8$h)*&Y6mG~_aOuvEei(8nrTwK~RQR>_U$BIrG z_W`*C`8owgg0n_%5Z-JXb8DhYRITM4Zp)i)wAT> zVHgw=@X{13&ZUPZ@Ou=7=~{M$-qKb4GTCAGHGH>L3gRfw<_YmXi2?pkVqCw{+U}0p z4gKN3qilw-mgot>`~yo%OMUe$X-NY^PK$vp@Q0%j0}Z8#q18sv`IhBcRbA+}{W;Z} zc=fvU`Y=)$`v?-bcA=P7_jvr=K+-o!^%i+G6Kf>V{({Kl{K~Oa;?Ph@ysE9JHXc_f z6mR4O6O$`Zsf?Hd-Y;>sH5gh!I%Twv+LIA{#2RZ7+Dk(8=LV;WjUuHb#C9rPQ3M9= zB`Yx8=O=dxgWK6hgW9Dk4RBJ@T7^nQ5YHw{BiQlH3rFDCjZoJd5@y(`7M~E&Gf=Z1?pZC{&$lAgAxE+g0RrEeMdR}?~;D{a@IiGZ6ra>^O+3nsR}|0nr##@J6*EY9Tqo0R_nQf8TSQjb0tNZqo`kSwaTN19uaPm>_e-sw}| zT!w3ZKLm^&J9O;kx*Dcb1y!{4W~I|9ej&{f=TsaBz$5+QqXxr7liP_r!!kl^guRDx zHWeHku|pr}-eJqRTpo@_T%ky_yM`p96)FM+|1^6W=v*1o=KMXn?r~@Y)21mS>j2V$ zvCBwaEou3`;Q<0a!;`bkDLpuvynGO{lpyf|P_>-uyXvN2ue)a%>A^Ib6o}cEr$4$u z^2B;BrIY<5^NZU}iR1Y!1MLFRc}pbcd9d(%$DZm)U%pk<3XhjaA^u6LIsyfLyzbFE zdzJK|pxT*{jZu;tK6;LT9Pt=rV&X>qY4NX=u|Fse4qf{kM3c)2mtp7w$u}^w z_?CV@bWf$=-+xl_WM}MVbpCkDj1_PwO2-b)yf=MZOsCU*k5CJ2jnBlu_;ytgbgsCx z3Q6bHt?$V>^H?(so<`NUUbcU$Txa^?wmG)tGYlUzxH4nX>Ppe0ynKEPd72l>I+DYB zh}yiEFkan+QN5(5b^M;kP``HZu9`b5exOhRs!me2SrlKe3dzPLLP)sEb*FQz4M{C5>MfdeQ+$LdX9DR{U&6yzHHJ_P#KsT0@40PF|t%gC7s zSWOv>cP@1JE{P%*iQ*_d$KeO;SiPZ_fby%Twffv}4ga2Lt|Xbn+%ZR%;G!Qjq8EAS zb z3V({8AgCWCAQuHSd$fT$YUG(VxmOTI_7?}1I-2;n;yhZt0vwOTbPn&5Oe8uN^lXBk z?eN0|T_AX52qu!*kkCT@btS1X!u-3L2iObO8(NL_9W%JIQKt$X8Uq3Aj0l=L*$03& z<2{?+^ca^^j;XDgEA1)z@|wJqseW+&2<)yXacLX&j}cZH9K)Qs`bbw0UpqG7d}Dpf zs$NY##eTE48$YiilInzEpI66N zI2+tE=@K)+_)R@>jzPvK(qYB>_{(T))C3x@@)dg2hy%_q1v~3fG3&#X{mL=zO!raC zT8{=o5faEra!#j(v1kNyxWZ#+oZ&nk_;#8G416}n6Wjrbhc%7WrSB`MQ9M!P72llk zL|k|3(?K&pz4^Y!s1T0l;O8)tND9 z^Lz7j_%h3`@gV0K7zT4nF)+o%CYP;^)NAT zPy{*R_Th`lSze&hGCff?l1cy`r9C2!iuBr)bEcoj*s;|q!qYx%V{oqeU(o2{jG5@1 z?ocGQQ`~MwBdrJ8%~fI2fQ)DcM@DBFp^R&57RY)Qam*`LBR9Ms#12ac!~Im>DB3HZ zk8GVgU*77PvEfS6?U<^K@~T8&jhF0UoA&nHLITIHb!Lqho#ou-TME{Hg*#6x5ntQ5QZu|0|GPvnzBr%kS z>J{H1qhhh5$%?pD|Jk_fD{p57k?izO` zn**5Ubd+3eIyd;QATsq=N`WSt2Nl;S@{j=RBn1`-U2ieommsFMenu-uLt(PkzgS_h zDRr^VCQHc~=@xQ#By#8K8;bnAVrfQT9J5W2+x%(XyeYWFmu#ky3#sdQx*R547&kE6 z2Np`Ldv$nR_=8$Z&4ck|)jUT#7RClv)?t`>?c43-XAH=e76VD`JY~J{1=YC6mkoa} zDBkAHY`4cBMYXw}2RgJmwc^;L9TP)|cx)e6euMD5!=hZCB+Bf-> zk=-Xzb!gSI%uK}+grd#5wlhUWjSKJ~dBYROrL0z5+}h_nDqeXr!`+M1bXI~S2(pBv z#5Od3sc(D$2m=LEUH&Nr%_pWPVGR5xV4zRw(kkN*r*9hetdWHfl5rEHeSDZh9Su$rX!M zn{9Corn4K2w=rR9HehbVAf#_6z7G#J;0(UM7|8~G0OEG(I6yHPIi7!FJK1++aJM5H zeUs|-9FPp#=_j>2XAZYHLS!AJS9NWV^QQ%$|2#xPuFHr)cnuGP#AJRI*@@98&e!ZV z#2*`t7GY1>A!id{k@e`iA>MF*LV1m@Up_6&UMl?73+r=gimw&P>b>opHCe3|QWVY5zCL}#FK!-}?}q!I`xGEJP=Gic zLs?IoK{ZkUw^^CtR|tiT=H8!g*^6}f`hG(*^6OzB8^mM&T1akh6$SJMa|6wE0D8s|P6b1j4z znL4PIG5H-cLRTa4B!yV%Y13ST7L<2N(4_PY&DsxPCr2v5(A-gAoqsdQvt(xFi7EHY zKgniO=utTL98b+0u-s>FNd{FpI34b=#wJ^t%uK%eaoJ}I4?IFwRtGhfrc7DNawR8~ z0-V`-f3_Kejr#-MaB(jTIqD}&?|-NHdFKnCL9K;3HZH4^Pw3IICM{ffsh~12_@c5m z!qR4MmU7?ZXgS0OR%Wzl>U92@EvqHYagZZZn7j>7S9zQw$fs!S&M}vHK!87^o1kHf z#*?9Vf}HLD>J|2aot%9fTbf>85}@AQvTDg%E@Nmh$G#KBD187{8;~Q2KX7f!U7enX zQ05C&abx^WUK?2wfm>MheD7;ko+}Ux#xEtl34&~Ux`IPHH<~BpfHNen&aw0Ir*bK{ zx`JMz|LOLfF|Y#5;#yY^Z0*R?u=a}KQZnAmMDcwK!?&*ezf^;+V*a9Sf2CMZxZU{6 zqY76$aj%4?tx_i@67I7wC2R=ZbTI9^T6138)y~NDets792Y?I)EgN z(9_O=Xafyj=w$7^j+11>Q8{jHR#Ai>1$z4$!^P;qITPP;(r&4<9|knW{6s z$m4t1r?5cHhP5d7q+D;$ND(vC$2D!hL4+OqQu>PY@@HpvA*72R6$!1>x%_8G^yvjw z3lEblCu-Q#OVo|JJv0axj18veUC!H+3^}`w%&KBk(7kmicSP~gS0Yk1ZP05tnpG3 z6Jg==&Ow6uBSvIi+(FUBkMsz3qmi})4;RYb-d}zk5-i4@8De*arjS#C&&GDdp+R@d zGG3PY(lVrPVgf$T&L%ufAI?kwmZ&_DrJd;u(T!+EM-ckmE)l!b&RNmXRuxft)0;mK7cUe;Fj%&o4Wk}&+Hmh`gMWwbVW&^5%Ui*M zJ{B|K1Aqd9D(E@sb0e!>7voc1Y<|aah}~ZA^yO8gGg9^kj(O0O)#;~m*!Obhl&cT}Kg6KK-n` ziBD_>ox{%DP8rb@iar43C|lu>Zzf-vI66ZOAZXUa(W|Lu!byGU#=Yzk3HU{LiEnhJ zIYqGTf)bh+#aBP>25;;Ld+(fP9m9%*+OFNklZt+R=@9L(5X#J9J^ZYXSJDC<7if{i zkD$;xqG7YsBhpZ#%~vQf)>zRtmgGOmj9BdaWqdqp1$S&%nwx_Iu^d)*I9D(J$}v4oG%mDUzGql?yQeH%<%EF_L7RgtaD1n}ZN8cnJl~WP8Cb7Uafn9&4iwF4 z!PSKa7$$=t-7cdTJebM4I;Cagk;^KO?eb?H!<0FV?vQXrG}rxlX}EpwNx)6Zw5B+P z(d*euk%y^S?#NFml8QbmJuRtsKgEGK^&*W96gq*@a6?k1iHEkDjbhOWk`zKge%AcVHvS zG-Sd5qg&qchfww;8>g9tPIn=iKl#d>t-6Ucd^p6I*z`GZdr};9b&Ds}#N!A1ye_bE zn_K2)Kob{Qin<-;x-ti;q@Eiks0fj;&T&@vmH??w!c(H}CNNDy*_xt5m2^iidG1Dt zIP3G@!vCNDvDXr(=Ww?0)GM3|G1q`!#wX4JCjKDWNCENORT&57gmFlwgZ$jtTVJVV zSog8;yh&%}MZOP!L`-1ss~UJ9-;xqFi?m*E&YafS2f!&bRts^9)lPIHzxKLc)O94F zC#_qIHu(aLO{P-GVdxL4M3Q3N<|d3GSTd;P^T7)F81rK@sTuD?fF4Q5 z%s$pu!BJ;;p=(`R`!lE#g(EiOkZ-VzqHKwpGkC9OV4-D{5Y=B?XKcaCAe48tDZXV| zYj>w7&6r>jIL22@CG3E7qJ3+(1}$7Y{uZ$Dyvh*5m9C{m#mVZW?~Tu>=zPm=5u7(4 zgN~mVi;JUgXHlD&70#baMO7s->9$U;*Q4J?nT;-kiPrJi)l3t@VSP^6l_tJSfa4O& zi;SaI6n1VxmS@wmiJv%@v96icB)(`l&V0?7LnkYVIIyj}gSm7B=aVd_Ru0XJjy> zi}M?I?aKpOdSCgD;eLVi;TGLO8VReMT0Ti-U++u#B0I4epUAM51^0YpV{srafcdgK!b%UHr3y5O# zagV|NenPch?kEKwh52+B4>*IkHKp~fV=MzgrjW_} zWjB2OP3|hb!U6_fpExxA(U%WE%xB8|-v=C!d?n!iNPPRhZ*f@tWa$@r08N66TOMKGCR6GCUMof;9qp}@NWXo8h%&oKbDxMTDA1Cq={qV zz)})*jsgD-BJA(CxX^!D6=#_dAN#k!AEZ;of1{N6=Kudr|FaVRDQu9Et-$?@X=p`L za{S3s2zzX(?(*ZpB|iWFMV6qzv|2Q{t~`L8UlM0PRk{tD9|;Eg04{?hInraGG#0qH zHl`R-v6z^~-yQn>rT$K-eEd%O@>UiLzfPWf=mysui%J$2Kbu4GLlv0_SLO>vtxYH? z^J=G@>WflxQ-#n5HSl>jsNcJC(?s#R1~G|6aMl=Xk&NA3`%GWHTdGL-+E?oRsB#d> zX+aRLseuta8mhlwGT~0L1}}y3--&AuBF^C?3s7MI*CJhO-fG4PE(`D|S-5O;XwB|p zql9;Z5DMO8$`N^wM5?w1U9+k&TRLv>Ft?iV#dJ(ZK!f=*wxA>|D@OT`UzCIC0cv+} zDO`@}w`2fkYvyBS=^E(jgP4>x{=I<*fOjtrNGT7bMLNo@DF|fabOEv9iW;d6;!xTi zf4Qla{;B{{16X7>tWi)BPnU%+8+mqchy~V5m^l3=w@XghNH9V!?-i1QevZ((BqDb? zR271DeA|M$X+sIn>HJR3ndsLko8{8Td8Hb?kLa8yc|(n75}vJAxItdbW{oYQO(G>D z*9?8?aaIU52(M-CnK@cb>GEz$ z$`@a1Lxe4-_KaG*FU8$8c%op>Hoo5Iq1VrO4&fam3J`hJbCFz?V_V&nv0CN>CzSO~ zL5F@>&g+r1qIKPFgm@CUg+?KgPJ%}&!M7Fi_&EVL+XeED{7Tt>4FK-cPxfWmIckJY zeLU9`%p9a`trl{E4Qm3BnURMMNP-FqvJyawEdZCj%&h4P)4yIeSfezrz`gQC(_j-j2+h# z!Fu3Hh{A6Bm3H_`CEOU+asP<)!Ot^yvEO+BYg~VMBaQN}yU30e`3C33WOcx*J0fSI z8r%EIfWu66Un<{j`*6s}AcK_!ek9;>LBsc+srH7 z3_LD+w)S{+L+<$j@<8)LR3hS=cn?K{MDUzVJI4`WC!y!$WmMqU!>V`5K2CH_QX=D~ z7GNB4dG^@Vv($>mXe2XOK648#l8Cw^lMrk1OMyFtz2&7~ME%h3EW}KezOBnDnCc=Z z-#VjnZ`5n9A83Is1ZJAt>q2N?m~gFz$Bw&^AAsmMXxRkWjA=&suAbzK$RK1x>8Z0m z1TC+tiV5mSwwxPXO9WbG036TA!U$eF0u7gZw;&DuV7ETN9dl0g!1lpf~up->BFjl@!d3r3-0v!KK z#-8u$wWA`pI<|$$xtM4X@r35MeNAY*`s(($L&}QXTnGrG>r97f$`Z-9yDo^lOrYyJs!Q&fa(_1QR>>Sap3bw#O_5+@3 zPb~7BWY|Cm$GjhC!kjDc)JtB262~Lo!DXllm(&$gs{-Q7dtyvgz|6{@SHnE9?Toz3>tPmk&(G+ZW4_M9Oue+B86~auHTzQhY9Q1n>{#NTB2fe z75QR6TvMa5Dp)Rm6fCH|`ZMndqKJ0%&ew=n(A1dt!ey$@kqh6H9!}f+9J*E3Ffyz7 zTB~Ro!~8v;)mmk-NPgLpv^SzNDA*ZgbHBmO#KC&U+6LE@Ob6&#aUJBFtUR)X3fR2- zk{AQ`+fiP-U>>;{l@T-1mtKc9$M=n75mrxW*nTykSHMIaic{g7KX3}1(|NZBI_Mcis{|VUgDVR+&hz!CGMtZ#)ob!krAq zEJ89SyN2bKnQ~7E`BUfJRx0hqu8&wM*-1F;A<=|0>NIv?R*?~l9FCg!KVPH}>@s*h z018Lts_P`HNAkY*4D|ye)&cI%>95uVa*smAhq5#iIzIU%L;N>UzU2y7vph<5d;LWF zKBQL!E6`n3Qr{1X_!+?8dvGp*dRF?XHyrWW$qYRU`u6tf zP1C=5VT&|}ls9{YyR@UFf%`uQ@F$Z#ixGIN1N(4n!-_AooHjT0-Y6x1(fp>yPdlSO zca=qa&^c`p)yREtedfc!k&w>PxkDf(hbq4Xm*?1nek!5%o1MpkVHc2WP;g_l;V>+=$OFS`0e-ss2(n}IA!q8w^U8$ga$1Cw6|c{Wtbac{65lL#pgPXO(2)#`XFbr z^m-diYw4-b@YNpys}Y-+o4*dv&{1d{HY@7VDl>)}bP*m6;BJ=%EVUz{H9g@W9f$S2 zqIKdW17x;(5K82)1V~baqCit#N&TE-)Zogkt$a{kE>T2a8BcTROKzSJBwN)DQJPvHWe*jJ&>;nj`+x61ybm~^$&pA2B*1vU9D~_^T^z&TslKfJj?{5Wo4Py$yHqK zWGh?c)6CCkPf*!gc9=fE} z+o0F_S?$gVla2Qt#WpwKI>*@L$u%KA3#3Ag3-90iu$1Y8!umlIk_i8 zF2kM?Lod8TPyhM;t?k5dVX-l3WeBx>HL$FwKkhR&WM$#5wt^!vs{`#tVX289-3aV# zZEkk-=*HM2qODTxO!j2XW-B}o;aG-}2vumoF96R9$twzAq<%u_Am&Ff(+RoeTswY4 zg%a6$cZIW+s(OMi3vtuL;NScXDV+Q)z3E27cNbn?&nb4ixvqV#?Gye1s55u#5=1!k z9QR4Xl=%8QsX32ayU`>OoHv;yasB}az!%vUkY*S8eZ8D$lz2ZYOo&4YiZkz%DmtP*H`h#wRlspJf7+$_4=nzJa5n zRQF7Ul();@=$bo!w&TyW(KHK)4DJqTcWhaTBp?!wqL`=12504qUTf*C{6hZwXb>?t z|N7ZmDmwbE^oOg1eAbiL3o-LXRcZ2Tiv0&*_`h8-@PCS+*Rs1Wz85$FgAWXNGO}uw zQ<21|EY2_%-Sq4TUHLNPS|O$y0F`(^gZsYO@52UCaKUn@21kw$z?VGtto&c<>107i z@_i#uJ{87zuq&o08WvHe7~lVPYSTy~vy5r`%*LCaHQk0G8BCCi@1PX~r3*{$^p($@ z@Q1wqrarl=%PHS38A91SMSY}cUSJf{=6<%idDiwya2_O+QaG2y)c^x0SEGx%L3Wgy z&A5gQ4q2BHqwp9Ce!yen=}dX>_@R38tl)mR@Ul$O?5dPSfakM20&tCLKQX2MYL3%w z%d5kSqslgB%X+PqT+x*N$ewI@{_N9PGXo=sYGQ6=80DE+GXOsK@QW=Y?zZ2TH0fqY zKYj@JcV>ts2!V8Zs3^Qv$_gnr$YS$N5Aow4n|yfgQnLY1TC@@O zYur9Yp*E{3Ao)@)c73;ldZMt{3a#07!!9`h z2)sdSBT!6n0c|LGm#DVkp{k@d_F8go5h>xDjOHlF!NpmYvbYCk8}C$(eLdog@rCcZiJ>V`XW5>}#~aP=@n=`jh$l3|@cba2HlY__ zN?@{h@Hk=@RDo~OG2Y#cmHh{)e!%f;Q&y-drvuv#b^vK;c}-;O>q|sK)ANr%4c4y* zb>8Z})O7YoxV%aNNHe@vPLzB1h&<0?&*xalWkoJ83=LA1)&bjeGt?{W{o2_bg87ir zUHIy$;A(N!Ro5!ur5h9rK@DcpgCwjyP!D_@fvBx&#jma*wQ>eenF<4ZE!W>$ek^Sm zGA$1^@{{tQWGuX<|9Y+Vi0yV`!V)c$C%7VLruYPbaB5@nF5L}|E+R|xK=dE#0$gx`R16V`ZgG%4|ukSj^Fw55kR3g(woP%8m(+xBy#h_$Mn zLcw*nS-8)EnD~!Fh>K(*c7lb6tz*+|X_}vX-qo0d#9eAHhz1#mjYgE5KAqT!z@itl zsyH)uR-9{9DrlnQgEPi}l)T2wmPE|HJ^+zD3tON!idxsYy#2 /dev/null 2>&1 \ + && test $$countdown -gt 0; do \ + $(DX_LATEX) refman.tex; \ + countdown=`expr $$countdown - 1`; \ + done; \ + $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi + +endif DX_COND_ps + +## ------------------------------ ## +## Rules specific for PDF output. ## +## ------------------------------ ## + +if DX_COND_pdf + +DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf + +DX_PDF_GOAL = doxygen-pdf + +doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf + +@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag + cd @DX_DOCDIR@/latex; \ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ + $(DX_PDFLATEX) refman.tex; \ + $(DX_MAKEINDEX) refman.idx; \ + $(DX_PDFLATEX) refman.tex; \ + countdown=5; \ + while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ + refman.log > /dev/null 2>&1 \ + && test $$countdown -gt 0; do \ + $(DX_PDFLATEX) refman.tex; \ + countdown=`expr $$countdown - 1`; \ + done; \ + mv refman.pdf ../@PACKAGE@.pdf + +endif DX_COND_pdf + +## ------------------------------------------------- ## +## Rules specific for LaTeX (shared for PS and PDF). ## +## ------------------------------------------------- ## + +if DX_COND_latex + +DX_CLEAN_LATEX = @DX_DOCDIR@/latex + +endif DX_COND_latex + +.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) + +.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) + +doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag + +doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) + +@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) + rm -rf @DX_DOCDIR@ + $(DX_ENV) DX_INCLUDE=$(DX_INCLUDE) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) + +DX_CLEANFILES = \ + @DX_DOCDIR@/@PACKAGE@.tag \ + -r \ + $(DX_CLEAN_HTML) \ + $(DX_CLEAN_CHM) \ + $(DX_CLEAN_CHI) \ + $(DX_CLEAN_MAN) \ + $(DX_CLEAN_RTF) \ + $(DX_CLEAN_XML) \ + $(DX_CLEAN_PS) \ + $(DX_CLEAN_PDF) \ + $(DX_CLEAN_LATEX) + +endif DX_COND_doc diff --git a/doxygen.cfg b/doxygen.cfg new file mode 100644 index 0000000..1c136a6 --- /dev/null +++ b/doxygen.cfg @@ -0,0 +1,255 @@ +# Doxyfile 1.4.6 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = $(PROJECT)-$(VERSION) +PROJECT_NUMBER = +OUTPUT_DIRECTORY = $(DOCDIR) +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = YES +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = $(SRCDIR) +STRIP_FROM_INC_PATH = $(SRCDIR) +SHORT_NAMES = YES +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 4 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(SRCDIR)/shibsp +FILE_PATTERNS = *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = $(SRCDIR)/shibsp +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +USE_HTAGS = NO +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = $(GENERATE_HTML) +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = $(GENERATE_CHM) +CHM_FILE = ../$(PROJECT).chm +HHC_LOCATION = $(HHC_PATH) +GENERATE_CHI = $(GENERATE_CHI) +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = $(GENERATE_LATEX) +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = $(PAPER_SIZE) +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = YES +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = $(GENERATE_RTF) +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = $(GENERATE_MAN) +MAN_OUTPUT = man +MAN_EXTENSION = .1 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = $(GENERATE_XML) +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = $(SRCDIR) $(DX_INCLUDE) +INCLUDE_FILE_PATTERNS = +PREDEFINED = _MSC_VER \ + DOXYGEN_SKIP +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = $(DOCDIR)/$(PROJECT).tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = $(PERL_PATH) +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = $(HAVE_DOT) +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = $(DOT_PATH) +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/doxygen.m4 b/doxygen.m4 new file mode 100644 index 0000000..e4688de --- /dev/null +++ b/doxygen.m4 @@ -0,0 +1,312 @@ +# This file is part of Autoconf. -*- Autoconf -*- + +# Copyright (C) 2004 Oren Ben-Kiki +# This file is distributed under the same terms as the Autoconf macro files. + +# Generate automatic documentation using Doxygen. Works in concert with the +# aminclude.m4 file and a compatible doxygen configuration file. Defines the +# following public macros: +# +# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature. +# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics, +# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI' +# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF', +# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment +# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide' +# paper size. +# +# By default, HTML, PDF and PS documentation is generated as this seems to be +# the most popular and portable combination. MAN pages created by Doxygen are +# usually problematic, though by picking an appropriate subset and doing some +# massaging they might be better than nothing. CHM and RTF are specific for MS +# (note that you can't generate both HTML and CHM at the same time). The XML is +# rather useless unless you apply specialized post-processing to it. +# +# The macro mainly controls the default state of the feature. The use can +# override the default by specifying --enable or --disable. The macros ensure +# that contradictory flags are not given (e.g., --enable-doxygen-html and +# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.) +# Finally, each feature will be automatically disabled (with a warning) if the +# required programs are missing. +# +# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with +# the following parameters: a one-word name for the project for use as a +# filename base etc., an optional configuration file name (the default is +# 'Doxyfile', the same as Doxygen's default), and an optional output directory +# name (the default is 'doxygen-doc'). + +## ----------## +## Defaults. ## +## ----------## + +DX_ENV="" +AC_DEFUN([DX_FEATURE_doc], ON) +AC_DEFUN([DX_FEATURE_dot], ON) +AC_DEFUN([DX_FEATURE_man], OFF) +AC_DEFUN([DX_FEATURE_html], ON) +AC_DEFUN([DX_FEATURE_chm], OFF) +AC_DEFUN([DX_FEATURE_chi], OFF) +AC_DEFUN([DX_FEATURE_rtf], OFF) +AC_DEFUN([DX_FEATURE_xml], OFF) +AC_DEFUN([DX_FEATURE_pdf], ON) +AC_DEFUN([DX_FEATURE_ps], ON) + +## --------------- ## +## Private macros. ## +## --------------- ## + +# DX_ENV_APPEND(VARIABLE, VALUE) +# ------------------------------ +# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen. +AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])]) + +# DX_DIRNAME_EXPR +# --------------- +# Expand into a shell expression prints the directory part of a path. +AC_DEFUN([DX_DIRNAME_EXPR], + [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) + +# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) +# ------------------------------------- +# Expands according to the M4 (static) status of the feature. +AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) + +# DX_REQUIRE_PROG(VARIABLE, PROGRAM) +# ---------------------------------- +# Require the specified program to be found for the DX_CURRENT_FEATURE to work. +AC_DEFUN([DX_REQUIRE_PROG], [ +AC_PATH_TOOL([$1], [$2]) +if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then + AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) + AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0) +fi +]) + +# DX_TEST_FEATURE(FEATURE) +# ------------------------ +# Expand to a shell expression testing whether the feature is active. +AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) + +# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) +# ------------------------------------------------- +# Verify that a required features has the right state before trying to turn on +# the DX_CURRENT_FEATURE. +AC_DEFUN([DX_CHECK_DEPEND], [ +test "$DX_FLAG_$1" = "$2" \ +|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, + requires, contradicts) doxygen-DX_CURRENT_FEATURE]) +]) + +# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) +# ---------------------------------------------------------- +# Turn off the DX_CURRENT_FEATURE if the required feature is off. +AC_DEFUN([DX_CLEAR_DEPEND], [ +test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0) +]) + +# DX_FEATURE_ARG(FEATURE, DESCRIPTION, +# CHECK_DEPEND, CLEAR_DEPEND, +# REQUIRE, DO-IF-ON, DO-IF-OFF) +# -------------------------------------------- +# Parse the command-line option controlling a feature. CHECK_DEPEND is called +# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), +# otherwise CLEAR_DEPEND is called to turn off the default state if a required +# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional +# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and +# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. +AC_DEFUN([DX_ARG_ABLE], [ + AC_DEFUN([DX_CURRENT_FEATURE], [$1]) + AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) + AC_ARG_ENABLE(doxygen-$1, + [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], + [--enable-doxygen-$1]), + DX_IF_FEATURE([$1], [don't $2], [$2]))], + [ +case "$enableval" in +#( +y|Y|yes|Yes|YES) + AC_SUBST([DX_FLAG_$1], 1) + $3 +;; #( +n|N|no|No|NO) + AC_SUBST([DX_FLAG_$1], 0) +;; #( +*) + AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) +;; +esac +], [ +AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) +$4 +]) +if DX_TEST_FEATURE([$1]); then + $5 + : +fi +if DX_TEST_FEATURE([$1]); then + AM_CONDITIONAL(DX_COND_$1, :) + $6 + : +else + AM_CONDITIONAL(DX_COND_$1, false) + $7 + : +fi +]) + +## -------------- ## +## Public macros. ## +## -------------- ## + +# DX_XXX_FEATURE(DEFAULT_STATE) +# ----------------------------- +AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) +AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])]) +AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) +AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])]) +AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])]) +AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])]) +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) +AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])]) +AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])]) + +# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR]) +# --------------------------------------------------------- +# PROJECT also serves as the base name for the documentation files. +# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc". +AC_DEFUN([DX_INIT_DOXYGEN], [ + +# Files: +AC_SUBST([DX_PROJECT], [$1]) +AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])]) +AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])]) + +# Environment variables used inside doxygen.cfg: +DX_ENV_APPEND(SRCDIR, $srcdir) +DX_ENV_APPEND(PROJECT, $DX_PROJECT) +DX_ENV_APPEND(DOCDIR, $DX_DOCDIR) +DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) + +# Doxygen itself: +DX_ARG_ABLE(doc, [generate any doxygen documentation], + [], + [], + [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) + DX_REQUIRE_PROG([DX_PERL], perl)], + [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) + +# Dot for graphics: +DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_DOT], dot)], + [DX_ENV_APPEND(HAVE_DOT, YES) + DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], + [DX_ENV_APPEND(HAVE_DOT, NO)]) + +# Man pages generation: +DX_ARG_ABLE(man, [generate doxygen manual pages], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_MAN, YES)], + [DX_ENV_APPEND(GENERATE_MAN, NO)]) + +# RTF file generation: +DX_ARG_ABLE(rtf, [generate doxygen RTF documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_RTF, YES)], + [DX_ENV_APPEND(GENERATE_RTF, NO)]) + +# XML file generation: +DX_ARG_ABLE(xml, [generate doxygen XML documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_XML, YES)], + [DX_ENV_APPEND(GENERATE_XML, NO)]) + +# (Compressed) HTML help generation: +DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_HHC], hhc)], + [DX_ENV_APPEND(HHC_PATH, $DX_HHC) + DX_ENV_APPEND(GENERATE_HTML, YES) + DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], + [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) + +# Seperate CHI file generation. +DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], + [DX_CHECK_DEPEND(chm, 1)], + [DX_CLEAR_DEPEND(chm, 1)], + [], + [DX_ENV_APPEND(GENERATE_CHI, YES)], + [DX_ENV_APPEND(GENERATE_CHI, NO)]) + +# Plain HTML pages generation: +DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], + [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)], + [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)], + [], + [DX_ENV_APPEND(GENERATE_HTML, YES)], + [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)]) + +# PostScript file generation: +DX_ARG_ABLE(ps, [generate doxygen PostScript documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_LATEX], latex) + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) + DX_REQUIRE_PROG([DX_DVIPS], dvips) + DX_REQUIRE_PROG([DX_EGREP], egrep)]) + +# PDF file generation: +DX_ARG_ABLE(pdf, [generate doxygen PDF documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex) + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) + DX_REQUIRE_PROG([DX_EGREP], egrep)]) + +# LaTeX generation for PS and/or PDF: +if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then + AM_CONDITIONAL(DX_COND_latex, :) + DX_ENV_APPEND(GENERATE_LATEX, YES) +else + AM_CONDITIONAL(DX_COND_latex, false) + DX_ENV_APPEND(GENERATE_LATEX, NO) +fi + +# Paper size for PS and/or PDF: +AC_ARG_VAR(DOXYGEN_PAPER_SIZE, + [a4wide (default), a4, letter, legal or executive]) +case "$DOXYGEN_PAPER_SIZE" in +#( +"") + AC_SUBST(DOXYGEN_PAPER_SIZE, "") +;; #( +a4wide|a4|letter|legal|executive) + DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE) +;; #( +*) + AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE']) +;; +esac + +#For debugging: +#echo DX_FLAG_doc=$DX_FLAG_doc +#echo DX_FLAG_dot=$DX_FLAG_dot +#echo DX_FLAG_man=$DX_FLAG_man +#echo DX_FLAG_html=$DX_FLAG_html +#echo DX_FLAG_chm=$DX_FLAG_chm +#echo DX_FLAG_chi=$DX_FLAG_chi +#echo DX_FLAG_rtf=$DX_FLAG_rtf +#echo DX_FLAG_xml=$DX_FLAG_xml +#echo DX_FLAG_pdf=$DX_FLAG_pdf +#echo DX_FLAG_ps=$DX_FLAG_ps +#echo DX_ENV=$DX_ENV +]) diff --git a/fastcgi/Makefile.am b/fastcgi/Makefile.am new file mode 100644 index 0000000..f0bec65 --- /dev/null +++ b/fastcgi/Makefile.am @@ -0,0 +1,30 @@ +AUTOMAKE_OPTIONS = foreign + +if BUILD_FASTCGI + +fastcgidir = $(libdir)/@PACKAGE@ + +fastcgi_PROGRAMS = shibauthorizer shibresponder + +shibauthorizer_SOURCES = shibauthorizer.cpp +shibauthorizer_CXXFLAGS = -I$(FASTCGI_INCLUDE) +shibauthorizer_LDFLAGS = $(FASTCGI_LDFLAGS) $(FASTCGI_LIBS) +shibauthorizer_LDADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +shibresponder_SOURCES = shibresponder.cpp +shibresponder_CXXFLAGS = -I$(FASTCGI_INCLUDE) +shibresponder_LDFLAGS = $(FASTCGI_LDFLAGS) $(FASTCGI_LIBS) +shibresponder_LDADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +endif + +EXTRA_DIST = \ + shibauthorizer.cpp \ + shibauthorizer.vcproj \ + shibauthorizer.rc \ + shibresponder.cpp \ + shibresponder.vcproj \ + shibresponder.rc \ + resource.h diff --git a/fastcgi/Makefile.in b/fastcgi/Makefile.in new file mode 100644 index 0000000..edb6b30 --- /dev/null +++ b/fastcgi/Makefile.in @@ -0,0 +1,607 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@BUILD_FASTCGI_TRUE@fastcgi_PROGRAMS = shibauthorizer$(EXEEXT) \ +@BUILD_FASTCGI_TRUE@ shibresponder$(EXEEXT) +subdir = fastcgi +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(fastcgidir)" +fastcgiPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(fastcgi_PROGRAMS) +am__shibauthorizer_SOURCES_DIST = shibauthorizer.cpp +@BUILD_FASTCGI_TRUE@am_shibauthorizer_OBJECTS = \ +@BUILD_FASTCGI_TRUE@ shibauthorizer-shibauthorizer.$(OBJEXT) +shibauthorizer_OBJECTS = $(am_shibauthorizer_OBJECTS) +@BUILD_FASTCGI_TRUE@shibauthorizer_DEPENDENCIES = \ +@BUILD_FASTCGI_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la +am__shibresponder_SOURCES_DIST = shibresponder.cpp +@BUILD_FASTCGI_TRUE@am_shibresponder_OBJECTS = \ +@BUILD_FASTCGI_TRUE@ shibresponder-shibresponder.$(OBJEXT) +shibresponder_OBJECTS = $(am_shibresponder_OBJECTS) +@BUILD_FASTCGI_TRUE@shibresponder_DEPENDENCIES = \ +@BUILD_FASTCGI_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(shibauthorizer_SOURCES) $(shibresponder_SOURCES) +DIST_SOURCES = $(am__shibauthorizer_SOURCES_DIST) \ + $(am__shibresponder_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +@BUILD_FASTCGI_TRUE@fastcgidir = $(libdir)/@PACKAGE@ +@BUILD_FASTCGI_TRUE@shibauthorizer_SOURCES = shibauthorizer.cpp +@BUILD_FASTCGI_TRUE@shibauthorizer_CXXFLAGS = -I$(FASTCGI_INCLUDE) +@BUILD_FASTCGI_TRUE@shibauthorizer_LDFLAGS = $(FASTCGI_LDFLAGS) $(FASTCGI_LIBS) +@BUILD_FASTCGI_TRUE@shibauthorizer_LDADD = \ +@BUILD_FASTCGI_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la + +@BUILD_FASTCGI_TRUE@shibresponder_SOURCES = shibresponder.cpp +@BUILD_FASTCGI_TRUE@shibresponder_CXXFLAGS = -I$(FASTCGI_INCLUDE) +@BUILD_FASTCGI_TRUE@shibresponder_LDFLAGS = $(FASTCGI_LDFLAGS) $(FASTCGI_LIBS) +@BUILD_FASTCGI_TRUE@shibresponder_LDADD = \ +@BUILD_FASTCGI_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la + +EXTRA_DIST = \ + shibauthorizer.cpp \ + shibauthorizer.vcproj \ + shibauthorizer.rc \ + shibresponder.cpp \ + shibresponder.vcproj \ + shibresponder.rc \ + resource.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fastcgi/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign fastcgi/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-fastcgiPROGRAMS: $(fastcgi_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(fastcgidir)" || $(mkdir_p) "$(DESTDIR)$(fastcgidir)" + @list='$(fastcgi_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(fastcgiPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(fastcgidir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(fastcgiPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(fastcgidir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-fastcgiPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(fastcgi_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(fastcgidir)/$$f'"; \ + rm -f "$(DESTDIR)$(fastcgidir)/$$f"; \ + done + +clean-fastcgiPROGRAMS: + @list='$(fastcgi_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +shibauthorizer$(EXEEXT): $(shibauthorizer_OBJECTS) $(shibauthorizer_DEPENDENCIES) + @rm -f shibauthorizer$(EXEEXT) + $(CXXLINK) $(shibauthorizer_LDFLAGS) $(shibauthorizer_OBJECTS) $(shibauthorizer_LDADD) $(LIBS) +shibresponder$(EXEEXT): $(shibresponder_OBJECTS) $(shibresponder_DEPENDENCIES) + @rm -f shibresponder$(EXEEXT) + $(CXXLINK) $(shibresponder_LDFLAGS) $(shibresponder_OBJECTS) $(shibresponder_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shibauthorizer-shibauthorizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shibresponder-shibresponder.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +shibauthorizer-shibauthorizer.o: shibauthorizer.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibauthorizer_CXXFLAGS) $(CXXFLAGS) -MT shibauthorizer-shibauthorizer.o -MD -MP -MF "$(DEPDIR)/shibauthorizer-shibauthorizer.Tpo" -c -o shibauthorizer-shibauthorizer.o `test -f 'shibauthorizer.cpp' || echo '$(srcdir)/'`shibauthorizer.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/shibauthorizer-shibauthorizer.Tpo" "$(DEPDIR)/shibauthorizer-shibauthorizer.Po"; else rm -f "$(DEPDIR)/shibauthorizer-shibauthorizer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='shibauthorizer.cpp' object='shibauthorizer-shibauthorizer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibauthorizer_CXXFLAGS) $(CXXFLAGS) -c -o shibauthorizer-shibauthorizer.o `test -f 'shibauthorizer.cpp' || echo '$(srcdir)/'`shibauthorizer.cpp + +shibauthorizer-shibauthorizer.obj: shibauthorizer.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibauthorizer_CXXFLAGS) $(CXXFLAGS) -MT shibauthorizer-shibauthorizer.obj -MD -MP -MF "$(DEPDIR)/shibauthorizer-shibauthorizer.Tpo" -c -o shibauthorizer-shibauthorizer.obj `if test -f 'shibauthorizer.cpp'; then $(CYGPATH_W) 'shibauthorizer.cpp'; else $(CYGPATH_W) '$(srcdir)/shibauthorizer.cpp'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/shibauthorizer-shibauthorizer.Tpo" "$(DEPDIR)/shibauthorizer-shibauthorizer.Po"; else rm -f "$(DEPDIR)/shibauthorizer-shibauthorizer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='shibauthorizer.cpp' object='shibauthorizer-shibauthorizer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibauthorizer_CXXFLAGS) $(CXXFLAGS) -c -o shibauthorizer-shibauthorizer.obj `if test -f 'shibauthorizer.cpp'; then $(CYGPATH_W) 'shibauthorizer.cpp'; else $(CYGPATH_W) '$(srcdir)/shibauthorizer.cpp'; fi` + +shibresponder-shibresponder.o: shibresponder.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibresponder_CXXFLAGS) $(CXXFLAGS) -MT shibresponder-shibresponder.o -MD -MP -MF "$(DEPDIR)/shibresponder-shibresponder.Tpo" -c -o shibresponder-shibresponder.o `test -f 'shibresponder.cpp' || echo '$(srcdir)/'`shibresponder.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/shibresponder-shibresponder.Tpo" "$(DEPDIR)/shibresponder-shibresponder.Po"; else rm -f "$(DEPDIR)/shibresponder-shibresponder.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='shibresponder.cpp' object='shibresponder-shibresponder.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibresponder_CXXFLAGS) $(CXXFLAGS) -c -o shibresponder-shibresponder.o `test -f 'shibresponder.cpp' || echo '$(srcdir)/'`shibresponder.cpp + +shibresponder-shibresponder.obj: shibresponder.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibresponder_CXXFLAGS) $(CXXFLAGS) -MT shibresponder-shibresponder.obj -MD -MP -MF "$(DEPDIR)/shibresponder-shibresponder.Tpo" -c -o shibresponder-shibresponder.obj `if test -f 'shibresponder.cpp'; then $(CYGPATH_W) 'shibresponder.cpp'; else $(CYGPATH_W) '$(srcdir)/shibresponder.cpp'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/shibresponder-shibresponder.Tpo" "$(DEPDIR)/shibresponder-shibresponder.Po"; else rm -f "$(DEPDIR)/shibresponder-shibresponder.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='shibresponder.cpp' object='shibresponder-shibresponder.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shibresponder_CXXFLAGS) $(CXXFLAGS) -c -o shibresponder-shibresponder.obj `if test -f 'shibresponder.cpp'; then $(CYGPATH_W) 'shibresponder.cpp'; else $(CYGPATH_W) '$(srcdir)/shibresponder.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(fastcgidir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-fastcgiPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-fastcgiPROGRAMS + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-fastcgiPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean \ + clean-fastcgiPROGRAMS clean-generic clean-libtool ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am \ + install-fastcgiPROGRAMS install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-fastcgiPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/fastcgi/resource.h b/fastcgi/resource.h new file mode 100644 index 0000000..55162af --- /dev/null +++ b/fastcgi/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by isapi_shib.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/fastcgi/shibauthorizer.cpp b/fastcgi/shibauthorizer.cpp new file mode 100644 index 0000000..65fc832 --- /dev/null +++ b/fastcgi/shibauthorizer.cpp @@ -0,0 +1,407 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* shibauthorizer.cpp - Shibboleth FastCGI Authorizer + + Andre Cruz +*/ + +#define SHIBSP_LITE +#include "config_win32.h" + +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#define _CRT_SECURE_NO_DEPRECATE 1 +#define _SCL_SECURE_NO_WARNINGS 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef HAVE_UNISTD_H +# include +# include +#endif +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); +static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); + +typedef enum { + SHIB_RETURN_OK, + SHIB_RETURN_KO, + SHIB_RETURN_DONE +} shib_return_t; + +class ShibTargetFCGIAuth : public AbstractSPRequest +{ + FCGX_Request* m_req; + int m_port; + string m_scheme,m_hostname; + multimap m_response_headers; +public: + map m_request_headers; + + ShibTargetFCGIAuth(FCGX_Request* req, const char* scheme=NULL, const char* hostname=NULL, int port=0) + : AbstractSPRequest(SHIBSP_LOGCAT".FastCGI"), m_req(req) { + const char* server_name_str = hostname; + if (!server_name_str || !*server_name_str) + server_name_str = FCGX_GetParam("SERVER_NAME", req->envp); + m_hostname = server_name_str; + + m_port = port; + if (!m_port) { + char* server_port_str = FCGX_GetParam("SERVER_PORT", req->envp); + m_port = strtol(server_port_str, &server_port_str, 10); + if (*server_port_str) { + cerr << "can't parse SERVER_PORT (" << FCGX_GetParam("SERVER_PORT", req->envp) << ")" << endl; + throw runtime_error("Unable to determine server port."); + } + } + + const char* server_scheme_str = scheme; + if (!server_scheme_str || !*server_scheme_str) + server_scheme_str = (m_port == 443 || m_port == 8443) ? "https" : "http"; + m_scheme = server_scheme_str; + + setRequestURI(FCGX_GetParam("REQUEST_URI", m_req->envp)); + } + + ~ShibTargetFCGIAuth() { } + + const char* getScheme() const { + return m_scheme.c_str(); + } + const char* getHostname() const { + return m_hostname.c_str(); + } + int getPort() const { + return m_port; + } + const char* getMethod() const { + return FCGX_GetParam("REQUEST_METHOD", m_req->envp); + } + string getContentType() const { + const char* s = FCGX_GetParam("CONTENT_TYPE", m_req->envp); + return s ? s : ""; + } + long getContentLength() const { + const char* s = FCGX_GetParam("CONTENT_LENGTH", m_req->envp); + return s ? atol(s) : 0; + } + string getRemoteAddr() const { + const char* s = FCGX_GetParam("REMOTE_ADDR", m_req->envp); + return s ? s : ""; + } + void log(SPLogLevel level, const string& msg) const { + AbstractSPRequest::log(level,msg); + if (level >= SPError) + cerr << "shib: " << msg; + } + void clearHeader(const char* rawname, const char* cginame) { + // no need, since request headers turn into actual environment variables + } + void setHeader(const char* name, const char* value) { + if (value) + m_request_headers[name] = value; + else + m_request_headers.erase(name); + } + virtual string getHeader(const char* name) const { + map::const_iterator i = m_request_headers.find(name); + if (i != m_request_headers.end()) + return i->second; + else + return ""; + } + void setRemoteUser(const char* user) { + if (user) + m_request_headers["REMOTE_USER"] = user; + else + m_request_headers.erase("REMOTE_USER"); + } + string getRemoteUser() const { + map::const_iterator i = m_request_headers.find("REMOTE_USER"); + if (i != m_request_headers.end()) + return i->second; + else { + char* remote_user = FCGX_GetParam("REMOTE_USER", m_req->envp); + if (remote_user) + return remote_user; + } + return ""; + } + void setResponseHeader(const char* name, const char* value) { + // Set for later. + if (value) + m_response_headers.insert(make_pair(name,value)); + else + m_response_headers.erase(name); + } + const char* getQueryString() const { + return FCGX_GetParam("QUERY_STRING", m_req->envp); + } + const char* getRequestBody() const { + throw runtime_error("getRequestBody not implemented by FastCGI authorizer."); + } + + long sendResponse(istream& in, long status) { + string hdr = string("Connection: close\r\n"); + for (multimap::const_iterator i=m_response_headers.begin(); i!=m_response_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + + // We can't return 200 OK here or else the filter is bypassed + // so custom Shib errors will get turned into a generic page. + const char* codestr="Status: 500 Server Error"; + switch (status) { + case XMLTOOLING_HTTP_STATUS_UNAUTHORIZED: codestr="Status: 401 Authorization Required"; break; + case XMLTOOLING_HTTP_STATUS_FORBIDDEN: codestr="Status: 403 Forbidden"; break; + case XMLTOOLING_HTTP_STATUS_NOTFOUND: codestr="Status: 404 Not Found"; break; + } + cout << codestr << "\r\n" << hdr << "\r\n"; + char buf[1024]; + while (in) { + in.read(buf,1024); + cout.write(buf, in.gcount()); + } + return SHIB_RETURN_DONE; + } + + long sendRedirect(const char* url) { + string hdr=string("Status: 302 Please Wait\r\nLocation: ") + url + "\r\n" + "Content-Type: text/html\r\n" + "Content-Length: 40\r\n" + "Expires: 01-Jan-1997 12:00:00 GMT\r\n" + "Cache-Control: private,no-store,no-cache\r\n"; + for (multimap::const_iterator i=m_response_headers.begin(); i!=m_response_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + hdr += "\r\n"; + + cout << hdr << "Redirecting..."; + return SHIB_RETURN_DONE; + } + + long returnDecline() { + return SHIB_RETURN_KO; + } + + long returnOK() { + return SHIB_RETURN_OK; + } + + const vector& getClientCertificates() const { + static vector g_NoCerts; + return g_NoCerts; + } +}; + +static void print_ok(const map& headers) +{ + cout << "Status: 200 OK" << "\r\n"; + for (map::const_iterator iter = headers.begin(); iter != headers.end(); iter++) { + cout << "Variable-" << iter->first << ": " << iter->second << "\r\n"; + } + cout << "\r\n"; +} + +static void print_error(const char* msg) +{ + cout << "Status: 500 Server Error" << "\r\n\r\n" << msg; +} + +int main(void) +{ + SPConfig* g_Config=&SPConfig::getConfig(); + g_Config->setFeatures( + SPConfig::Listener | + SPConfig::Caching | + SPConfig::RequestMapping | + SPConfig::InProcess | + SPConfig::Logging | + SPConfig::Handlers + ); + if (!g_Config->init()) { + cerr << "failed to initialize Shibboleth libraries" << endl; + exit(1); + } + + const char* config=getenv("SHIBSP_CONFIG"); + if (!config) + config=SHIBSP_CONFIG; + + try { + DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(config); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + g_Config->getServiceProvider()->init(); + } + catch (exception& ex) { + g_Config->term(); + cerr << "exception while initializing Shibboleth configuration: " << ex.what() << endl; + exit(1); + } + + string g_ServerScheme; + string g_ServerName; + int g_ServerPort=0; + + // Load "authoritative" URL fields. + char* var = getenv("SHIBSP_SERVER_NAME"); + if (var) + g_ServerName = var; + var = getenv("SHIBSP_SERVER_SCHEME"); + if (var) + g_ServerScheme = var; + var = getenv("SHIBSP_SERVER_PORT"); + if (var) + g_ServerPort = atoi(var); + + streambuf* cout_streambuf = cout.rdbuf(); + streambuf* cerr_streambuf = cerr.rdbuf(); + + FCGX_Request request; + + FCGX_Init(); + FCGX_InitRequest(&request, 0, 0); + + cout << "Shibboleth initialization complete. Starting request loop." << endl; + while (FCGX_Accept_r(&request) == 0) + { + // Note that the default bufsize (0) will cause the use of iostream + // methods that require positioning (such as peek(), seek(), + // unget() and putback()) to fail (in favour of more efficient IO). + fcgi_streambuf cout_fcgi_streambuf(request.out); + fcgi_streambuf cerr_fcgi_streambuf(request.err); + + cout.rdbuf(&cout_fcgi_streambuf); + cerr.rdbuf(&cerr_fcgi_streambuf); + + try { + xmltooling::NDC ndc("FastCGI shibauthorizer"); + ShibTargetFCGIAuth sta(&request, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort); + + pair res = sta.getServiceProvider().doAuthentication(sta); + if (res.first) { +#ifdef _DEBUG + cerr << "shib: doAuthentication handled the request" << endl; +#endif + switch(res.second) { + case SHIB_RETURN_OK: + print_ok(sta.m_request_headers); + continue; + + case SHIB_RETURN_KO: + print_ok(sta.m_request_headers); + continue; + + case SHIB_RETURN_DONE: + continue; + + default: + cerr << "shib: doAuthentication returned an unexpected result: " << res.second << endl; + print_error("FastCGI Shibboleth authorizer returned an unexpected result."); + continue; + } + } + + res = sta.getServiceProvider().doExport(sta); + if (res.first) { +#ifdef _DEBUG + cerr << "shib: doExport handled request" << endl; +#endif + switch(res.second) { + case SHIB_RETURN_OK: + print_ok(sta.m_request_headers); + continue; + + case SHIB_RETURN_KO: + print_ok(sta.m_request_headers); + continue; + + case SHIB_RETURN_DONE: + continue; + + default: + cerr << "shib: doExport returned an unexpected result: " << res.second << endl; + print_error("FastCGI Shibboleth authorizer returned an unexpected result."); + continue; + } + } + + res = sta.getServiceProvider().doAuthorization(sta); + if (res.first) { +#ifdef _DEBUG + cerr << "shib: doAuthorization handled request" << endl; +#endif + switch(res.second) { + case SHIB_RETURN_OK: + print_ok(sta.m_request_headers); + continue; + + case SHIB_RETURN_KO: + print_ok(sta.m_request_headers); + continue; + + case SHIB_RETURN_DONE: + continue; + + default: + cerr << "shib: doAuthorization returned an unexpected result: " << res.second << endl; + print_error("FastCGI Shibboleth authorizer returned an unexpected result."); + continue; + } + } + + print_ok(sta.m_request_headers); + + } + catch (exception& e) { + cerr << "shib: FastCGI authorizer caught an exception: " << e.what() << endl; + print_error("FastCGI Shibboleth authorizer caught an exception, check log for details."); + } + + // If the output streambufs had non-zero bufsizes and + // were constructed outside of the accept loop (i.e. + // their destructor won't be called here), they would + // have to be flushed here. + } + cout << "Request loop ended." << endl; + + cout.rdbuf(cout_streambuf); + cerr.rdbuf(cerr_streambuf); + + if (g_Config) + g_Config->term(); + + return 0; +} diff --git a/fastcgi/shibauthorizer.rc b/fastcgi/shibauthorizer.rc new file mode 100644 index 0000000..ef47610 --- /dev/null +++ b/fastcgi/shibauthorizer.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth FastCGI Authorizer\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "shibauthorizer\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "shibauthorizer.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/fastcgi/shibauthorizer.vcproj b/fastcgi/shibauthorizer.vcproj new file mode 100644 index 0000000..8bf4121 --- /dev/null +++ b/fastcgi/shibauthorizer.vcproj @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fastcgi/shibresponder.cpp b/fastcgi/shibresponder.cpp new file mode 100644 index 0000000..f40a2e7 --- /dev/null +++ b/fastcgi/shibresponder.cpp @@ -0,0 +1,408 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* shibresponder.cpp - Shibboleth FastCGI Responder/Handler + + Andre Cruz +*/ + +#define SHIBSP_LITE +#include "config_win32.h" + +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#define _CRT_SECURE_NO_DEPRECATE 1 +#define _SCL_SECURE_NO_WARNINGS 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef HAVE_UNISTD_H +# include +# include +#endif +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); +static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); + +typedef enum { + SHIB_RETURN_OK, + SHIB_RETURN_KO, + SHIB_RETURN_DONE +} shib_return_t; + +class ShibTargetFCGI : public AbstractSPRequest +{ + FCGX_Request* m_req; + const char* m_body; + multimap m_headers; + int m_port; + string m_scheme,m_hostname; + +public: + ShibTargetFCGI(FCGX_Request* req, char* post_data, const char* scheme=NULL, const char* hostname=NULL, int port=0) + : AbstractSPRequest(SHIBSP_LOGCAT".FastCGI"), m_req(req), m_body(post_data) { + + const char* server_name_str = hostname; + if (!server_name_str || !*server_name_str) + server_name_str = FCGX_GetParam("SERVER_NAME", req->envp); + m_hostname = server_name_str; + + m_port = port; + if (!m_port) { + char* server_port_str = FCGX_GetParam("SERVER_PORT", req->envp); + m_port = strtol(server_port_str, &server_port_str, 10); + if (*server_port_str) { + cerr << "can't parse SERVER_PORT (" << FCGX_GetParam("SERVER_PORT", req->envp) << ")" << endl; + throw runtime_error("Unable to determine server port."); + } + } + + const char* server_scheme_str = scheme; + if (!server_scheme_str || !*server_scheme_str) + server_scheme_str = (m_port == 443 || m_port == 8443) ? "https" : "http"; + m_scheme = server_scheme_str; + + setRequestURI(FCGX_GetParam("REQUEST_URI", m_req->envp)); + } + + ~ShibTargetFCGI() { } + + const char* getScheme() const { + return m_scheme.c_str(); + } + const char* getHostname() const { + return m_hostname.c_str(); + } + int getPort() const { + return m_port; + } + const char* getMethod() const { + return FCGX_GetParam("REQUEST_METHOD", m_req->envp); + } + string getContentType() const { + const char* s = FCGX_GetParam("CONTENT_TYPE", m_req->envp); + return s ? s : ""; + } + long getContentLength() const { + const char* s = FCGX_GetParam("CONTENT_LENGTH", m_req->envp); + return s ? atol(s) : 0; + } + string getRemoteUser() const { + const char* s = FCGX_GetParam("REMOTE_USER", m_req->envp); + return s ? s : ""; + } + string getRemoteAddr() const { + const char* s = FCGX_GetParam("REMOTE_ADDR", m_req->envp); + return s ? s : ""; + } + void log(SPLogLevel level, const string& msg) const { + AbstractSPRequest::log(level,msg); + if (level >= SPError) + cerr << "shib: " << msg; + } + + string getHeader(const char* name) const { + string hdr("HTTP_"); + for (; *name; ++name) { + if (*name=='-') + hdr += '_'; + else + hdr += toupper(*name); + } + char* s = FCGX_GetParam(hdr.c_str(), m_req->envp); + return s ? s : ""; + } + + void setResponseHeader(const char* name, const char* value) { + // Set for later. + if (value) + m_headers.insert(make_pair(name,value)); + else + m_headers.erase(name); + } + + const char* getQueryString() const { + return FCGX_GetParam("QUERY_STRING", m_req->envp); + } + + const char* getRequestBody() const { + return m_body; + } + + long sendResponse(istream& in, long status) { + string hdr = string("Connection: close\r\n"); + for (multimap::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + + const char* codestr="Status: 200 OK"; + switch (status) { + case XMLTOOLING_HTTP_STATUS_ERROR: codestr="Status: 500 Server Error"; break; + case XMLTOOLING_HTTP_STATUS_UNAUTHORIZED: codestr="Status: 401 Authorization Required"; break; + case XMLTOOLING_HTTP_STATUS_FORBIDDEN: codestr="Status: 403 Forbidden"; break; + case XMLTOOLING_HTTP_STATUS_NOTFOUND: codestr="Status: 404 Not Found"; break; + } + cout << codestr << "\r\n" << hdr << "\r\n"; + char buf[1024]; + while (in) { + in.read(buf,1024); + cout.write(buf, in.gcount()); + } + return SHIB_RETURN_DONE; + } + + long sendRedirect(const char* url) { + string hdr=string("Status: 302 Please Wait\r\nLocation: ") + url + "\r\n" + "Content-Type: text/html\r\n" + "Content-Length: 40\r\n" + "Expires: 01-Jan-1997 12:00:00 GMT\r\n" + "Cache-Control: private,no-store,no-cache\r\n"; + for (multimap::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + hdr += "\r\n"; + + cout << hdr << "Redirecting..."; + return SHIB_RETURN_DONE; + } + + long returnDecline() { + return SHIB_RETURN_KO; + } + long returnOK() { + return SHIB_RETURN_OK; + } + + const vector& getClientCertificates() const { + static vector g_NoCerts; + return g_NoCerts; + } + + // Not used in the extension. + + virtual void clearHeader(const char* rawname, const char* cginame) { + throw runtime_error("clearHeader not implemented by FastCGI responder."); + } + + virtual void setHeader(const char* name, const char* value) { + throw runtime_error("setHeader not implemented by FastCGI responder."); + } + + virtual void setRemoteUser(const char* user) { + throw runtime_error("setRemoteUser not implemented by FastCGI responder."); + } +}; + +// Maximum number of bytes allowed to be read from stdin +static const unsigned long STDIN_MAX = 1000000; + +static long gstdin(FCGX_Request* request, char** content) +{ + char* clenstr = FCGX_GetParam("CONTENT_LENGTH", request->envp); + unsigned long clen = STDIN_MAX; + + if (clenstr) { + clen = strtol(clenstr, &clenstr, 10); + if (*clenstr) { + cerr << "can't parse CONTENT_LENGTH (" << FCGX_GetParam("CONTENT_LENGTH", request->envp) << ")" << endl; + clen = STDIN_MAX; + } + + // *always* put a cap on the amount of data that will be read + if (clen > STDIN_MAX) + clen = STDIN_MAX; + + *content = new char[clen]; + + cin.read(*content, clen); + clen = cin.gcount(); + } + else { + // *never* read stdin when CONTENT_LENGTH is missing or unparsable + *content = 0; + clen = 0; + } + + // Chew up any remaining stdin - this shouldn't be necessary + // but is because mod_fastcgi doesn't handle it correctly. + + // ignore() doesn't set the eof bit in some versions of glibc++ + // so use gcount() instead of eof()... + do cin.ignore(1024); while (cin.gcount() == 1024); + + return clen; +} + +static void print_ok() { + cout << "Status: 200 OK" << "\r\n\r\n"; +} + +static void print_error(const char* msg) { + cout << "Status: 500 Server Error" << "\r\n\r\n" << msg; +} + +int main(void) +{ + SPConfig* g_Config=&SPConfig::getConfig(); + g_Config->setFeatures( + SPConfig::Listener | + SPConfig::Caching | + SPConfig::RequestMapping | + SPConfig::InProcess | + SPConfig::Logging | + SPConfig::Handlers + ); + if (!g_Config->init()) { + cerr << "failed to initialize Shibboleth libraries" << endl; + exit(1); + } + + const char* config=getenv("SHIBSP_CONFIG"); + if (!config) + config=SHIBSP_CONFIG; + + try { + DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(config); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + g_Config->getServiceProvider()->init(); + } + catch (exception& ex) { + g_Config->term(); + cerr << "exception while initializing Shibboleth configuration: " << ex.what() << endl; + exit(1); + } + + string g_ServerScheme; + string g_ServerName; + int g_ServerPort=0; + + // Load "authoritative" URL fields. + char* var = getenv("SHIBSP_SERVER_NAME"); + if (var) + g_ServerName = var; + var = getenv("SHIBSP_SERVER_SCHEME"); + if (var) + g_ServerScheme = var; + var = getenv("SHIBSP_SERVER_PORT"); + if (var) + g_ServerPort = atoi(var); + + streambuf* cin_streambuf = cin.rdbuf(); + streambuf* cout_streambuf = cout.rdbuf(); + streambuf* cerr_streambuf = cerr.rdbuf(); + + FCGX_Request request; + + FCGX_Init(); + FCGX_InitRequest(&request, 0, 0); + + cout << "Shibboleth initialization complete. Starting request loop." << endl; + while (FCGX_Accept_r(&request) == 0) { + // Note that the default bufsize (0) will cause the use of iostream + // methods that require positioning (such as peek(), seek(), + // unget() and putback()) to fail (in favour of more efficient IO). + fcgi_streambuf cin_fcgi_streambuf(request.in); + fcgi_streambuf cout_fcgi_streambuf(request.out); + fcgi_streambuf cerr_fcgi_streambuf(request.err); + + cin.rdbuf(&cin_fcgi_streambuf); + cout.rdbuf(&cout_fcgi_streambuf); + cerr.rdbuf(&cerr_fcgi_streambuf); + + // Although FastCGI supports writing before reading, + // many http clients (browsers) don't support it (so + // the connection deadlocks until a timeout expires!). + char* content; + gstdin(&request, &content); + + try { + xmltooling::NDC ndc("FastCGI shibresponder"); + ShibTargetFCGI stf(&request, content, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort); + + pair res = stf.getServiceProvider().doHandler(stf); + if (res.first) { +#ifdef _DEBUG + cerr << "shib: doHandler handled the request" << endl; +#endif + switch(res.second) { + case SHIB_RETURN_OK: + print_ok(); + break; + + case SHIB_RETURN_KO: + cerr << "shib: doHandler failed to handle the request" << endl; + print_error("FastCGI Shibboleth responder should only be used for Shibboleth protocol requests."); + break; + + case SHIB_RETURN_DONE: + // response already handled + break; + + default: + cerr << "shib: doHandler returned an unexpected result: " << res.second << endl; + print_error("FastCGI Shibboleth responder returned an unexpected result."); + break; + } + } + else { + cerr << "shib: doHandler failed to handle request." << endl; + print_error("FastCGI Shibboleth responder failed to process request."); + } + + } + catch (exception& e) { + cerr << "shib: FastCGI responder caught an exception: " << e.what() << endl; + print_error("FastCGI Shibboleth responder caught an exception, check log for details."); + } + + delete[] content; + + // If the output streambufs had non-zero bufsizes and + // were constructed outside of the accept loop (i.e. + // their destructor won't be called here), they would + // have to be flushed here. + } + + cout << "Request loop ended." << endl; + + cin.rdbuf(cin_streambuf); + cout.rdbuf(cout_streambuf); + cerr.rdbuf(cerr_streambuf); + + if (g_Config) + g_Config->term(); + + return 0; +} diff --git a/fastcgi/shibresponder.rc b/fastcgi/shibresponder.rc new file mode 100644 index 0000000..0f0311a --- /dev/null +++ b/fastcgi/shibresponder.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth FastCGI Responder\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "shibresponder\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "shibresponder.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/fastcgi/shibresponder.vcproj b/fastcgi/shibresponder.vcproj new file mode 100644 index 0000000..c62262b --- /dev/null +++ b/fastcgi/shibresponder.vcproj @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..6ce63b9 --- /dev/null +++ b/install-sh @@ -0,0 +1,294 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "$0: no input file specified" >&2 + exit 1 +else + : +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d "$dst" ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f "$src" ] || [ -d "$src" ] + then + : + else + echo "$0: $src does not exist" >&2 + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "$0: no destination specified" >&2 + exit 1 + else + : + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d "$dst" ] + then + dst=$dst/`basename "$src"` + else + : + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' + ' +IFS="${IFS-$defaultIFS}" + +oIFS=$IFS +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS=$oIFS + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp=$pathcomp$1 + shift + + if [ ! -d "$pathcomp" ] ; + then + $mkdirprog "$pathcomp" + else + : + fi + + pathcomp=$pathcomp/ +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd "$dst" && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename "$dst"` + else + : + fi + +# Make a couple of temp file names in the proper directory. + + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + +# Trap to clean up temp files at exit. + + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + +# Move or copy the file name to the temp name + + $doit $instcmd "$src" "$dsttmp" && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && + +# Now remove or move aside any old file at destination location. We try this +# two ways since rm can't unlink itself on some systems and the destination +# file might be busy for other reasons. In this case, the final cleanup +# might fail but the new file should still install successfully. + +{ + if [ -f "$dstdir/$dstfile" ] + then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || + $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || + { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi +} && + +# Now rename the file to the real destination. + + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + +fi && + +# The final little trick to "correctly" pass the exit status to the exit trap. + +{ + (exit 0); exit +} diff --git a/isapi_shib/directive_class.h b/isapi_shib/directive_class.h new file mode 100644 index 0000000..88313f9 --- /dev/null +++ b/isapi_shib/directive_class.h @@ -0,0 +1,233 @@ +#include +#include +#define STR_PENDING_DELETION "(Pending Removal)" + +using namespace std; + +class Directive +{ +public: + + Directive() { + } + + ~Directive() { + } + + Directive(unsigned int which_directive) { + Init_Directive(which_directive); + } + + string name; + unsigned short type; + string value; + string new_value; + string defined_in; + string description; + string bound_val[NUM_BOUND_VAL]; + string MachineName; + unsigned int d_index; + + bool Set_Path(string new_path) + { + if (new_path.length() && new_path.at(0) == '/') { + path = new_path; + } else { + path = "/"; + path += new_path; + } + Get_Value(); + return true; + } + + bool WriteValue(string RegPath) + { + if (type == D_BOUND_INT || type == D_FREE_INT) { + return WriteRegInt(RegPath.c_str(), name.c_str(), new_value.c_str()); + } else { + return WriteRegString(RegPath.c_str(), name.c_str(), new_value.c_str()); + } + } + + void Directive::Init_Directive(unsigned int w) { + + if (w >= NUM_DIRECTIVES) { + return; + } + d_index = w; + name = directives[w].name; + type = directives[w].type; + value = directives[w].value; + defined_in = directives[w].defined_in; + description = directives[w].description; + for (int i=0;i +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +// globals +namespace { + static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); + static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); + static const XMLCh name[] = UNICODE_LITERAL_4(n,a,m,e); + static const XMLCh port[] = UNICODE_LITERAL_4(p,o,r,t); + static const XMLCh sslport[] = UNICODE_LITERAL_7(s,s,l,p,o,r,t); + static const XMLCh scheme[] = UNICODE_LITERAL_6(s,c,h,e,m,e); + static const XMLCh id[] = UNICODE_LITERAL_2(i,d); + static const XMLCh ISAPI[] = UNICODE_LITERAL_5(I,S,A,P,I); + static const XMLCh Alias[] = UNICODE_LITERAL_5(A,l,i,a,s); + static const XMLCh normalizeRequest[] = UNICODE_LITERAL_16(n,o,r,m,a,l,i,z,e,R,e,q,u,e,s,t); + static const XMLCh Site[] = UNICODE_LITERAL_4(S,i,t,e); + + struct site_t { + site_t(const DOMElement* e) + { + auto_ptr_char n(e->getAttributeNS(NULL,name)); + auto_ptr_char s(e->getAttributeNS(NULL,scheme)); + auto_ptr_char p(e->getAttributeNS(NULL,port)); + auto_ptr_char p2(e->getAttributeNS(NULL,sslport)); + if (n.get()) m_name=n.get(); + if (s.get()) m_scheme=s.get(); + if (p.get()) m_port=p.get(); + if (p2.get()) m_sslport=p2.get(); + e = XMLHelper::getFirstChildElement(e, Alias); + while (e) { + if (e->hasChildNodes()) { + auto_ptr_char alias(e->getFirstChild()->getNodeValue()); + m_aliases.insert(alias.get()); + } + e = XMLHelper::getNextSiblingElement(e, Alias); + } + } + string m_scheme,m_port,m_sslport,m_name; + set m_aliases; + }; + + struct context_t { + char* m_user; + bool m_checked; + }; + + HINSTANCE g_hinstDLL; + SPConfig* g_Config = NULL; + map g_Sites; + bool g_bNormalizeRequest = true; + string g_unsetHeaderValue; + bool g_checkSpoofing = true; + bool g_catchAll = false; + vector g_NoCerts; +} + +BOOL LogEvent( + LPCSTR lpUNCServerName, + WORD wType, + DWORD dwEventID, + PSID lpUserSid, + LPCSTR message) +{ + LPCSTR messages[] = {message, NULL}; + + HANDLE hElog = RegisterEventSource(lpUNCServerName, "Shibboleth ISAPI Filter"); + BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL); + return (DeregisterEventSource(hElog) && res); +} + +extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID) +{ + if (fdwReason==DLL_PROCESS_ATTACH) + g_hinstDLL=hinstDLL; + return TRUE; +} + +extern "C" BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO* pVer) +{ + if (!pVer) + return FALSE; + + if (!g_Config) { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, + "Extension mode startup not possible, is the DLL loaded as a filter?"); + return FALSE; + } + + pVer->dwExtensionVersion=HSE_VERSION; + strncpy(pVer->lpszExtensionDesc,"Shibboleth ISAPI Extension",HSE_MAX_EXT_DLL_NAME_LEN-1); + return TRUE; +} + +extern "C" BOOL WINAPI TerminateExtension(DWORD) +{ + return TRUE; // cleanup should happen when filter unloads +} + +extern "C" BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) +{ + if (!pVer) + return FALSE; + else if (g_Config) { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, + "Reentrant filter initialization, ignoring..."); + return TRUE; + } + + g_Config=&SPConfig::getConfig(); + g_Config->setFeatures( + SPConfig::Listener | + SPConfig::Caching | + SPConfig::RequestMapping | + SPConfig::InProcess | + SPConfig::Logging | + SPConfig::Handlers + ); + if (!g_Config->init()) { + g_Config=NULL; + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, + "Filter startup failed during library initialization, check native log for help."); + return FALSE; + } + + LPCSTR config=getenv("SHIBSP_CONFIG"); + if (!config) + config=SHIBSP_CONFIG; + + try { + DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(config); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + g_Config->getServiceProvider()->init(); + } + catch (exception& ex) { + g_Config->term(); + g_Config=NULL; + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, ex.what()); + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, + "Filter startup failed to load configuration, check native log for details."); + return FALSE; + } + + // Access implementation-specifics and site mappings. + ServiceProvider* sp=g_Config->getServiceProvider(); + Locker locker(sp); + const PropertySet* props=sp->getPropertySet("InProcess"); + if (props) { + pair unsetValue=props->getString("unsetHeaderValue"); + if (unsetValue.first) + g_unsetHeaderValue = unsetValue.second; + pair flag=props->getBool("checkSpoofing"); + g_checkSpoofing = !flag.first || flag.second; + flag=props->getBool("catchAll"); + g_catchAll = flag.first && flag.second; + + props = props->getPropertySet("ISAPI"); + if (props) { + flag = props->getBool("normalizeRequest"); + g_bNormalizeRequest = !flag.first || flag.second; + const DOMElement* child = XMLHelper::getFirstChildElement(props->getElement(),Site); + while (child) { + auto_ptr_char id(child->getAttributeNS(NULL,id)); + if (id.get()) + g_Sites.insert(pair(id.get(),site_t(child))); + child=XMLHelper::getNextSiblingElement(child,Site); + } + } + } + + pVer->dwFilterVersion=HTTP_FILTER_REVISION; + strncpy(pVer->lpszFilterDesc,"Shibboleth ISAPI Filter",SF_MAX_FILTER_DESC_LEN); + pVer->dwFlags=(SF_NOTIFY_ORDER_HIGH | + SF_NOTIFY_SECURE_PORT | + SF_NOTIFY_NONSECURE_PORT | + SF_NOTIFY_PREPROC_HEADERS | + SF_NOTIFY_LOG); + LogEvent(NULL, EVENTLOG_INFORMATION_TYPE, 7701, NULL, "Filter initialized..."); + return TRUE; +} + +extern "C" BOOL WINAPI TerminateFilter(DWORD) +{ + if (g_Config) + g_Config->term(); + g_Config = NULL; + LogEvent(NULL, EVENTLOG_INFORMATION_TYPE, 7701, NULL, "Filter shut down..."); + return TRUE; +} + +/* Next up, some suck-free versions of various APIs. + + You DON'T require people to guess the buffer size and THEN tell them the right size. + Returning an LPCSTR is apparently way beyond their ken. Not to mention the fact that + constant strings aren't typed as such, making it just that much harder. These versions + are now updated to use a special growable buffer object, modeled after the standard + string class. The standard string won't work because they left out the option to + pre-allocate a non-constant buffer. +*/ + +class dynabuf +{ +public: + dynabuf() { bufptr=NULL; buflen=0; } + dynabuf(size_t s) { bufptr=new char[buflen=s]; *bufptr=0; } + ~dynabuf() { delete[] bufptr; } + size_t length() const { return bufptr ? strlen(bufptr) : 0; } + size_t size() const { return buflen; } + bool empty() const { return length()==0; } + void reserve(size_t s, bool keep=false); + void erase() { if (bufptr) memset(bufptr,0,buflen); } + operator char*() { return bufptr; } + bool operator ==(const char* s) const; + bool operator !=(const char* s) const { return !(*this==s); } +private: + char* bufptr; + size_t buflen; +}; + +void dynabuf::reserve(size_t s, bool keep) +{ + if (s<=buflen) + return; + char* p=new char[s]; + if (keep) + while (buflen--) + p[buflen]=bufptr[buflen]; + buflen=s; + delete[] bufptr; + bufptr=p; +} + +bool dynabuf::operator==(const char* s) const +{ + if (buflen==NULL || s==NULL) + return (buflen==NULL && s==NULL); + else + return strcmp(bufptr,s)==0; +} + +void GetServerVariable(PHTTP_FILTER_CONTEXT pfc, LPSTR lpszVariable, dynabuf& s, DWORD size=80, bool bRequired=true) +{ + s.reserve(size); + s.erase(); + size=s.size(); + + while (!pfc->GetServerVariable(pfc,lpszVariable,s,&size)) { + // Grumble. Check the error. + DWORD e=GetLastError(); + if (e==ERROR_INSUFFICIENT_BUFFER) + s.reserve(size); + else + break; + } + if (bRequired && s.empty()) + throw ERROR_NO_DATA; +} + +void GetServerVariable(LPEXTENSION_CONTROL_BLOCK lpECB, LPSTR lpszVariable, dynabuf& s, DWORD size=80, bool bRequired=true) +{ + s.reserve(size); + s.erase(); + size=s.size(); + + while (!lpECB->GetServerVariable(lpECB->ConnID,lpszVariable,s,&size)) { + // Grumble. Check the error. + DWORD e=GetLastError(); + if (e==ERROR_INSUFFICIENT_BUFFER) + s.reserve(size); + else + break; + } + if (bRequired && s.empty()) + throw ERROR_NO_DATA; +} + +void GetHeader(PHTTP_FILTER_PREPROC_HEADERS pn, PHTTP_FILTER_CONTEXT pfc, + LPSTR lpszName, dynabuf& s, DWORD size=80, bool bRequired=true) +{ + s.reserve(size); + s.erase(); + size=s.size(); + + while (!pn->GetHeader(pfc,lpszName,s,&size)) { + // Grumble. Check the error. + DWORD e=GetLastError(); + if (e==ERROR_INSUFFICIENT_BUFFER) + s.reserve(size); + else + break; + } + if (bRequired && s.empty()) + throw ERROR_NO_DATA; +} + +/****************************************************************************/ +// ISAPI Filter + +class ShibTargetIsapiF : public AbstractSPRequest +{ + PHTTP_FILTER_CONTEXT m_pfc; + PHTTP_FILTER_PREPROC_HEADERS m_pn; + multimap m_headers; + int m_port; + string m_scheme,m_hostname; + mutable string m_remote_addr,m_content_type,m_method; + dynabuf m_allhttp; + +public: + ShibTargetIsapiF(PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_PREPROC_HEADERS pn, const site_t& site) + : AbstractSPRequest(SHIBSP_LOGCAT".ISAPI"), m_pfc(pfc), m_pn(pn), m_allhttp(4096) { + + // URL path always come from IIS. + dynabuf var(256); + GetHeader(pn,pfc,"url",var,256,false); + setRequestURI(var); + + // Port may come from IIS or from site def. + if (!g_bNormalizeRequest || (pfc->fIsSecurePort && site.m_sslport.empty()) || (!pfc->fIsSecurePort && site.m_port.empty())) { + GetServerVariable(pfc,"SERVER_PORT",var,10); + m_port = atoi(var); + } + else if (pfc->fIsSecurePort) { + m_port = atoi(site.m_sslport.c_str()); + } + else { + m_port = atoi(site.m_port.c_str()); + } + + // Scheme may come from site def or be derived from IIS. + m_scheme=site.m_scheme; + if (m_scheme.empty() || !g_bNormalizeRequest) + m_scheme=pfc->fIsSecurePort ? "https" : "http"; + + GetServerVariable(pfc,"SERVER_NAME",var,32); + + // Make sure SERVER_NAME is "authorized" for use on this site. If not, set to canonical name. + m_hostname = var; + if (site.m_name!=m_hostname && site.m_aliases.find(m_hostname)==site.m_aliases.end()) + m_hostname=site.m_name; + + if (!pfc->pFilterContext) { + pfc->pFilterContext = pfc->AllocMem(pfc, sizeof(context_t), NULL); + if (static_cast(pfc->pFilterContext)) { + static_cast(pfc->pFilterContext)->m_user = NULL; + static_cast(pfc->pFilterContext)->m_checked = false; + } + } + } + ~ShibTargetIsapiF() { } + + const char* getScheme() const { + return m_scheme.c_str(); + } + const char* getHostname() const { + return m_hostname.c_str(); + } + int getPort() const { + return m_port; + } + const char* getMethod() const { + if (m_method.empty()) { + dynabuf var(5); + GetServerVariable(m_pfc,"REQUEST_METHOD",var,5,false); + if (!var.empty()) + m_method = var; + } + return m_method.c_str(); + } + string getContentType() const { + if (m_content_type.empty()) { + dynabuf var(32); + GetServerVariable(m_pfc,"CONTENT_TYPE",var,32,false); + if (!var.empty()) + m_content_type = var; + } + return m_content_type; + } + long getContentLength() const { + return 0; + } + string getRemoteAddr() const { + if (m_remote_addr.empty()) { + dynabuf var(16); + GetServerVariable(m_pfc,"REMOTE_ADDR",var,16,false); + if (!var.empty()) + m_remote_addr = var; + } + return m_remote_addr; + } + void log(SPLogLevel level, const string& msg) { + AbstractSPRequest::log(level,msg); + if (level >= SPError) + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg.c_str()); + } + void clearHeader(const char* rawname, const char* cginame) { + if (g_checkSpoofing && m_pfc->pFilterContext && !static_cast(m_pfc->pFilterContext)->m_checked) { + if (m_allhttp.empty()) + GetServerVariable(m_pfc,"ALL_HTTP",m_allhttp,4096); + if (strstr(m_allhttp, cginame)) + throw opensaml::SecurityPolicyException("Attempt to spoof header ($1) was detected.", params(1, rawname)); + } + string hdr(!strcmp(rawname,"REMOTE_USER") ? "remote-user" : rawname); + hdr += ':'; + m_pn->SetHeader(m_pfc, const_cast(hdr.c_str()), const_cast(g_unsetHeaderValue.c_str())); + } + void setHeader(const char* name, const char* value) { + string hdr(name); + hdr += ':'; + m_pn->SetHeader(m_pfc, const_cast(hdr.c_str()), const_cast(value)); + } + string getHeader(const char* name) const { + string hdr(name); + hdr += ':'; + dynabuf buf(256); + GetHeader(m_pn, m_pfc, const_cast(hdr.c_str()), buf, 256, false); + return string(buf); + } + void setRemoteUser(const char* user) { + setHeader("remote-user", user); + if (m_pfc->pFilterContext) { + if (!user || !*user) + static_cast(m_pfc->pFilterContext)->m_user = NULL; + else if (static_cast(m_pfc->pFilterContext)->m_user = (char*)m_pfc->AllocMem(m_pfc, sizeof(char) * (strlen(user) + 1), NULL)) + strcpy(static_cast(m_pfc->pFilterContext)->m_user, user); + } + } + string getRemoteUser() const { + return getHeader("remote-user"); + } + void setResponseHeader(const char* name, const char* value) { + // Set for later. + if (value) + m_headers.insert(make_pair(name,value)); + else + m_headers.erase(name); + } + long sendResponse(istream& in, long status) { + string hdr = string("Connection: close\r\n"); + for (multimap::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + hdr += "\r\n"; + const char* codestr="200 OK"; + switch (status) { + case XMLTOOLING_HTTP_STATUS_UNAUTHORIZED: codestr="401 Authorization Required"; break; + case XMLTOOLING_HTTP_STATUS_FORBIDDEN: codestr="403 Forbidden"; break; + case XMLTOOLING_HTTP_STATUS_NOTFOUND: codestr="404 Not Found"; break; + case XMLTOOLING_HTTP_STATUS_ERROR: codestr="500 Server Error"; break; + } + m_pfc->ServerSupportFunction(m_pfc, SF_REQ_SEND_RESPONSE_HEADER, (void*)codestr, (DWORD)hdr.c_str(), 0); + char buf[1024]; + while (in) { + in.read(buf,1024); + DWORD resplen = in.gcount(); + m_pfc->WriteClient(m_pfc, buf, &resplen, 0); + } + return SF_STATUS_REQ_FINISHED; + } + long sendRedirect(const char* url) { + // XXX: Don't support the httpRedirect option, yet. + string hdr=string("Location: ") + url + "\r\n" + "Content-Type: text/html\r\n" + "Content-Length: 40\r\n" + "Expires: 01-Jan-1997 12:00:00 GMT\r\n" + "Cache-Control: private,no-store,no-cache\r\n"; + for (multimap::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + hdr += "\r\n"; + m_pfc->ServerSupportFunction(m_pfc, SF_REQ_SEND_RESPONSE_HEADER, "302 Please Wait", (DWORD)hdr.c_str(), 0); + static const char* redmsg="Redirecting..."; + DWORD resplen=40; + m_pfc->WriteClient(m_pfc, (LPVOID)redmsg, &resplen, 0); + return SF_STATUS_REQ_FINISHED; + } + long returnDecline() { + return SF_STATUS_REQ_NEXT_NOTIFICATION; + } + long returnOK() { + return SF_STATUS_REQ_NEXT_NOTIFICATION; + } + + const vector& getClientCertificates() const { + return g_NoCerts; + } + + // The filter never processes the POST, so stub these methods. + const char* getQueryString() const { throw IOException("getQueryString not implemented"); } + const char* getRequestBody() const { throw IOException("getRequestBody not implemented"); } +}; + +DWORD WriteClientError(PHTTP_FILTER_CONTEXT pfc, const char* msg) +{ + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg); + static const char* ctype="Connection: close\r\nContent-Type: text/html\r\n\r\n"; + pfc->ServerSupportFunction(pfc,SF_REQ_SEND_RESPONSE_HEADER,"200 OK",(DWORD)ctype,0); + static const char* xmsg="Shibboleth Filter Error" + "

Shibboleth Filter Error

"; + DWORD resplen=strlen(xmsg); + pfc->WriteClient(pfc,(LPVOID)xmsg,&resplen,0); + resplen=strlen(msg); + pfc->WriteClient(pfc,(LPVOID)msg,&resplen,0); + static const char* xmsg2=""; + resplen=strlen(xmsg2); + pfc->WriteClient(pfc,(LPVOID)xmsg2,&resplen,0); + return SF_STATUS_REQ_FINISHED; +} + +extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LPVOID pvNotification) +{ + // Is this a log notification? + if (notificationType==SF_NOTIFY_LOG) + { + if (pfc->pFilterContext) + ((PHTTP_FILTER_LOG)pvNotification)->pszClientUserName=static_cast(pfc->pFilterContext)->m_user; + return SF_STATUS_REQ_NEXT_NOTIFICATION; + } + + PHTTP_FILTER_PREPROC_HEADERS pn=(PHTTP_FILTER_PREPROC_HEADERS)pvNotification; + try + { + // Determine web site number. This can't really fail, I don't think. + dynabuf buf(128); + GetServerVariable(pfc,"INSTANCE_ID",buf,10); + + // Match site instance to host name, skip if no match. + map::const_iterator map_i=g_Sites.find(static_cast(buf)); + if (map_i==g_Sites.end()) + return SF_STATUS_REQ_NEXT_NOTIFICATION; + + ostringstream threadid; + threadid << "[" << getpid() << "] isapi_shib" << '\0'; + xmltooling::NDC ndc(threadid.str().c_str()); + + ShibTargetIsapiF stf(pfc, pn, map_i->second); + + // "false" because we don't override the Shib settings + pair res = stf.getServiceProvider().doAuthentication(stf); + if (pfc->pFilterContext) + static_cast(pfc->pFilterContext)->m_checked = true; + if (res.first) return res.second; + + // "false" because we don't override the Shib settings + res = stf.getServiceProvider().doExport(stf); + if (res.first) return res.second; + + res = stf.getServiceProvider().doAuthorization(stf); + if (res.first) return res.second; + + return SF_STATUS_REQ_NEXT_NOTIFICATION; + } + catch(bad_alloc) { + return WriteClientError(pfc,"Out of Memory"); + } + catch(long e) { + if (e==ERROR_NO_DATA) + return WriteClientError(pfc,"A required variable or header was empty."); + else + return WriteClientError(pfc,"Shibboleth Filter detected unexpected IIS error."); + } + catch (exception& e) { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, e.what()); + return WriteClientError(pfc,"Shibboleth Filter caught an exception, check Event Log for details."); + } + catch(...) { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "Shibboleth Filter threw an unknown exception."); + if (g_catchAll) + return WriteClientError(pfc,"Shibboleth Filter threw an unknown exception."); + throw; + } + + return WriteClientError(pfc,"Shibboleth Filter reached unreachable code, save my walrus!"); +} + + +/****************************************************************************/ +// ISAPI Extension + +DWORD WriteClientError(LPEXTENSION_CONTROL_BLOCK lpECB, const char* msg) +{ + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg); + static const char* ctype="Connection: close\r\nContent-Type: text/html\r\n\r\n"; + lpECB->ServerSupportFunction(lpECB->ConnID,HSE_REQ_SEND_RESPONSE_HEADER,"200 OK",0,(LPDWORD)ctype); + static const char* xmsg="Shibboleth Error

Shibboleth Error

"; + DWORD resplen=strlen(xmsg); + lpECB->WriteClient(lpECB->ConnID,(LPVOID)xmsg,&resplen,HSE_IO_SYNC); + resplen=strlen(msg); + lpECB->WriteClient(lpECB->ConnID,(LPVOID)msg,&resplen,HSE_IO_SYNC); + static const char* xmsg2=""; + resplen=strlen(xmsg2); + lpECB->WriteClient(lpECB->ConnID,(LPVOID)xmsg2,&resplen,HSE_IO_SYNC); + return HSE_STATUS_SUCCESS; +} + + +class ShibTargetIsapiE : public AbstractSPRequest +{ + LPEXTENSION_CONTROL_BLOCK m_lpECB; + multimap m_headers; + mutable vector m_certs; + mutable string m_body; + mutable bool m_gotBody; + int m_port; + string m_scheme,m_hostname,m_uri; + mutable string m_remote_addr,m_remote_user; + +public: + ShibTargetIsapiE(LPEXTENSION_CONTROL_BLOCK lpECB, const site_t& site) + : AbstractSPRequest(SHIBSP_LOGCAT".ISAPI"), m_lpECB(lpECB), m_gotBody(false) { + dynabuf ssl(5); + GetServerVariable(lpECB,"HTTPS",ssl,5); + bool SSL=(ssl=="on" || ssl=="ON"); + + // Scheme may come from site def or be derived from IIS. + m_scheme=site.m_scheme; + if (m_scheme.empty() || !g_bNormalizeRequest) + m_scheme = SSL ? "https" : "http"; + + // URL path always come from IIS. + dynabuf url(256); + GetServerVariable(lpECB,"URL",url,255); + + // Port may come from IIS or from site def. + dynabuf port(11); + if (!g_bNormalizeRequest || (SSL && site.m_sslport.empty()) || (!SSL && site.m_port.empty())) + GetServerVariable(lpECB,"SERVER_PORT",port,10); + else if (SSL) { + strncpy(port,site.m_sslport.c_str(),10); + static_cast(port)[10]=0; + } + else { + strncpy(port,site.m_port.c_str(),10); + static_cast(port)[10]=0; + } + m_port = atoi(port); + + dynabuf var(32); + GetServerVariable(lpECB, "SERVER_NAME", var, 32); + + // Make sure SERVER_NAME is "authorized" for use on this site. If not, set to canonical name. + m_hostname=var; + if (site.m_name!=m_hostname && site.m_aliases.find(m_hostname)==site.m_aliases.end()) + m_hostname=site.m_name; + + /* + * IIS screws us over on PATH_INFO (the hits keep on coming). We need to figure out if + * the server is set up for proper PATH_INFO handling, or "IIS sucks rabid weasels mode", + * which is the default. No perfect way to tell, but we can take a good guess by checking + * whether the URL is a substring of the PATH_INFO: + * + * e.g. for /Shibboleth.sso/SAML/POST + * + * Bad mode (default): + * URL: /Shibboleth.sso + * PathInfo: /Shibboleth.sso/SAML/POST + * + * Good mode: + * URL: /Shibboleth.sso + * PathInfo: /SAML/POST + */ + + string uri; + + // Clearly we're only in bad mode if path info exists at all. + if (lpECB->lpszPathInfo && *(lpECB->lpszPathInfo)) { + if (strstr(lpECB->lpszPathInfo,url)) + // Pretty good chance we're in bad mode, unless the PathInfo repeats the path itself. + uri = lpECB->lpszPathInfo; + else { + uri = url; + uri += lpECB->lpszPathInfo; + } + } + else { + uri = url; + } + + // For consistency with Apache, let's add the query string. + if (lpECB->lpszQueryString && *(lpECB->lpszQueryString)) { + uri += '?'; + uri += lpECB->lpszQueryString; + } + + setRequestURI(uri.c_str()); + } + ~ShibTargetIsapiE() { } + + const char* getScheme() const { + return m_scheme.c_str(); + } + const char* getHostname() const { + return m_hostname.c_str(); + } + int getPort() const { + return m_port; + } + const char* getMethod() const { + return m_lpECB->lpszMethod; + } + string getContentType() const { + return m_lpECB->lpszContentType ? m_lpECB->lpszContentType : ""; + } + long getContentLength() const { + return m_lpECB->cbTotalBytes; + } + string getRemoteUser() const { + if (m_remote_user.empty()) { + dynabuf var(16); + GetServerVariable(m_lpECB, "REMOTE_USER", var, 32, false); + if (!var.empty()) + m_remote_user = var; + } + return m_remote_user; + } + string getRemoteAddr() const { + if (m_remote_addr.empty()) { + dynabuf var(16); + GetServerVariable(m_lpECB, "REMOTE_ADDR", var, 16, false); + if (!var.empty()) + m_remote_addr = var; + } + return m_remote_addr; + } + void log(SPLogLevel level, const string& msg) const { + AbstractSPRequest::log(level,msg); + if (level >= SPError) + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg.c_str()); + } + string getHeader(const char* name) const { + string hdr("HTTP_"); + for (; *name; ++name) { + if (*name=='-') + hdr += '_'; + else + hdr += toupper(*name); + } + dynabuf buf(128); + GetServerVariable(m_lpECB, const_cast(hdr.c_str()), buf, 128, false); + return buf.empty() ? "" : buf; + } + void setResponseHeader(const char* name, const char* value) { + // Set for later. + if (value) + m_headers.insert(make_pair(name,value)); + else + m_headers.erase(name); + } + const char* getQueryString() const { + return m_lpECB->lpszQueryString; + } + const char* getRequestBody() const { + if (m_gotBody) + return m_body.c_str(); + if (m_lpECB->cbTotalBytes > 1024*1024) // 1MB? + throw opensaml::SecurityPolicyException("Size of request body exceeded 1M size limit."); + else if (m_lpECB->cbTotalBytes > m_lpECB->cbAvailable) { + m_gotBody=true; + char buf[8192]; + DWORD datalen=m_lpECB->cbTotalBytes; + while (datalen) { + DWORD buflen=8192; + BOOL ret = m_lpECB->ReadClient(m_lpECB->ConnID, buf, &buflen); + if (!ret || !buflen) + throw IOException("Error reading request body from browser."); + m_body.append(buf, buflen); + datalen-=buflen; + } + } + else if (m_lpECB->cbAvailable) { + m_gotBody=true; + m_body.assign(reinterpret_cast(m_lpECB->lpbData),m_lpECB->cbAvailable); + } + return m_body.c_str(); + } + long sendResponse(istream& in, long status) { + string hdr = string("Connection: close\r\n"); + for (multimap::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + hdr += "\r\n"; + const char* codestr="200 OK"; + switch (status) { + case XMLTOOLING_HTTP_STATUS_UNAUTHORIZED: codestr="401 Authorization Required"; break; + case XMLTOOLING_HTTP_STATUS_FORBIDDEN: codestr="403 Forbidden"; break; + case XMLTOOLING_HTTP_STATUS_NOTFOUND: codestr="404 Not Found"; break; + case XMLTOOLING_HTTP_STATUS_ERROR: codestr="500 Server Error"; break; + } + m_lpECB->ServerSupportFunction(m_lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, (void*)codestr, 0, (LPDWORD)hdr.c_str()); + char buf[1024]; + while (in) { + in.read(buf,1024); + DWORD resplen = in.gcount(); + m_lpECB->WriteClient(m_lpECB->ConnID, buf, &resplen, HSE_IO_SYNC); + } + return HSE_STATUS_SUCCESS; + } + long sendRedirect(const char* url) { + string hdr=string("Location: ") + url + "\r\n" + "Content-Type: text/html\r\n" + "Content-Length: 40\r\n" + "Expires: 01-Jan-1997 12:00:00 GMT\r\n" + "Cache-Control: private,no-store,no-cache\r\n"; + for (multimap::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i) + hdr += i->first + ": " + i->second + "\r\n"; + hdr += "\r\n"; + m_lpECB->ServerSupportFunction(m_lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, "302 Moved", 0, (LPDWORD)hdr.c_str()); + static const char* redmsg="Redirecting..."; + DWORD resplen=40; + m_lpECB->WriteClient(m_lpECB->ConnID, (LPVOID)redmsg, &resplen, HSE_IO_SYNC); + return HSE_STATUS_SUCCESS; + } + // Decline happens in the POST processor if this isn't the shire url + // Note that it can also happen with HTAccess, but we don't support that, yet. + long returnDecline() { + return WriteClientError( + m_lpECB, + "ISAPI extension can only be invoked to process Shibboleth protocol requests." + "Make sure the mapped file extension doesn't match actual content." + ); + } + long returnOK() { + return HSE_STATUS_SUCCESS; + } + + const vector& getClientCertificates() const { + if (m_certs.empty()) { + char CertificateBuf[8192]; + CERT_CONTEXT_EX ccex; + ccex.cbAllocated = sizeof(CertificateBuf); + ccex.CertContext.pbCertEncoded = (BYTE*)CertificateBuf; + DWORD dwSize = sizeof(ccex); + + if (m_lpECB->ServerSupportFunction(m_lpECB->ConnID, HSE_REQ_GET_CERT_INFO_EX, (LPVOID)&ccex, (LPDWORD)dwSize, NULL)) { + if (ccex.CertContext.cbCertEncoded) { + unsigned int outlen; + XMLByte* serialized = Base64::encode(reinterpret_cast(CertificateBuf), ccex.CertContext.cbCertEncoded, &outlen); + m_certs.push_back(reinterpret_cast(serialized)); + XMLString::release(&serialized); + } + } + } + return m_certs; + } + + // Not used in the extension. + void clearHeader(const char* rawname, const char* cginame) { throw runtime_error("clearHeader not implemented"); } + void setHeader(const char* name, const char* value) { throw runtime_error("setHeader not implemented"); } + void setRemoteUser(const char* user) { throw runtime_error("setRemoteUser not implemented"); } +}; + +extern "C" DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) +{ + try { + ostringstream threadid; + threadid << "[" << getpid() << "] isapi_shib_extension" << '\0'; + xmltooling::NDC ndc(threadid.str().c_str()); + + // Determine web site number. This can't really fail, I don't think. + dynabuf buf(128); + GetServerVariable(lpECB,"INSTANCE_ID",buf,10); + + // Match site instance to host name, skip if no match. + map::const_iterator map_i=g_Sites.find(static_cast(buf)); + if (map_i==g_Sites.end()) + return WriteClientError(lpECB, "Shibboleth Extension not configured for web site (check mappings in configuration)."); + + ShibTargetIsapiE ste(lpECB, map_i->second); + pair res = ste.getServiceProvider().doHandler(ste); + if (res.first) return res.second; + + return WriteClientError(lpECB, "Shibboleth Extension failed to process request"); + + } + catch(bad_alloc) { + return WriteClientError(lpECB,"Out of Memory"); + } + catch(long e) { + if (e==ERROR_NO_DATA) + return WriteClientError(lpECB,"A required variable or header was empty."); + else + return WriteClientError(lpECB,"Server detected unexpected IIS error."); + } + catch (exception& e) { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, e.what()); + return WriteClientError(lpECB,"Shibboleth Extension caught an exception, check Event Log for details."); + } + catch(...) { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "Shibboleth Extension threw an unknown exception."); + if (g_catchAll) + return WriteClientError(lpECB,"Shibboleth Extension threw an unknown exception."); + throw; + } + + // If we get here we've got an error. + return HSE_STATUS_ERROR; +} diff --git a/isapi_shib/isapi_shib.rc b/isapi_shib/isapi_shib.rc new file mode 100644 index 0000000..6ae70f3 --- /dev/null +++ b/isapi_shib/isapi_shib.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth ISAPI Filter / Extension\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "isapi_shib\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "isapi_shib.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/isapi_shib/isapi_shib.vcproj b/isapi_shib/isapi_shib.vcproj new file mode 100644 index 0000000..216a23c --- /dev/null +++ b/isapi_shib/isapi_shib.vcproj @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/isapi_shib/resource.h b/isapi_shib/resource.h new file mode 100644 index 0000000..f3772c1 --- /dev/null +++ b/isapi_shib/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by isapi_shib.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/libtool.m4 b/libtool.m4 new file mode 100644 index 0000000..b8940eb --- /dev/null +++ b/libtool.m4 @@ -0,0 +1,5960 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=yes + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided and an installed libltdl is not found, it is +# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_builddir and top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +# Report which librarie types wil actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDRT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $CC in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +SED=$lt_cv_path_SED +]) +AC_MSG_RESULT([$SED]) +]) diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000..23f82e3 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,6425 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# RH: define SED for historic ltconfig's generated by Libtool 1.3 +[ -z "$SED" ] && SED=sed + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.6 +TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)" + + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () { + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` + if test "X$win32_nmres" = "Ximport" ; then + win32_libid_type="x86 archive import" + else + win32_libid_type="x86 archive static" + fi + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () { + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2003 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $EXIT_SUCCESS + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $EXIT_SUCCESS + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $EXIT_SUCCESS + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) prevopt="--tag" prev=tag ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case "$arg_mode" in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo $srcfile > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit $EXIT_FAILURE + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # gcc -m* arguments should be passed to the linker via $compiler_flags + # in order to pass architecture information to the linker + # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo + # but this is not reliable with gcc because gcc may use -mfoo to + # select a different linker, different libraries, etc, while + # -Wl,-mfoo simply passes -mfoo to the linker. + -m*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + if test "$with_gcc" = "yes" ; then + compiler_flags="$compiler_flags $arg" + fi + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test "$status" -ne 0 && test ! -d "$output_objdir"; then + exit $status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + if test "$deplibs_check_method" != pass_all; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5* ) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$deplibs $path" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + [0-9]*) ;; + *) + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + [0-9]*) ;; + *) + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + [0-9]*) ;; + *) + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` + deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$save_output-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$save_output-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$save_output-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadale object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$output.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + cwrappersource=`$echo ${objdir}/lt-${output}.c` + cwrapper=`$echo ${output}.exe` + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +#define DIR_SEPARATOR '/' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +#define HAVE_DOS_BASED_FILE_SYSTEM +#ifndef DIR_SEPARATOR_2 +#define DIR_SEPARATOR_2 '\\' +#endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +char * basename (const char *name); +char * fnqualify(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup ((char *) basename (argv[0])); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = fnqualify(argv[0]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +char * +basename (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha (name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return (char *) base; +} + +char * +fnqualify(const char *path) +{ + size_t size; + char *p; + char tmp[LT_PATHMAX + 1]; + + assert(path != NULL); + + /* Is it qualified already? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha (path[0]) && path[1] == ':') + return xstrdup (path); +#endif + if (IS_DIR_SEPARATOR (path[0])) + return xstrdup (path); + + /* prepend the current directory */ + /* doesn't handle '~' */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ + p = XMALLOC(char, size); + sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); + return p; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + # GNU ar 2.10+ was changed to match POSIX; thus no paths are + # encoded into archives. This makes 'ar r' malfunction in + # this piecewise linking case whenever conflicting object + # names appear in distinct ar calls; check, warn and compensate. + if (for obj in $save_oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 + $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 + AR_FLAGS=cq + fi + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + save_umask=`umask` + umask 0077 + if $mkdir "$tmpdir"; then + umask $save_umask + else + umask $save_umask + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "----------------------------------------------------------------------" + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" + done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "----------------------------------------------------------------------" + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + + if test "$mode" = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + fi + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $EXIT_SUCCESS + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/missing b/missing new file mode 100755 index 0000000..fc54c64 --- /dev/null +++ b/missing @@ -0,0 +1,336 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.4 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..d2d5f21 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,111 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: +# mkinstalldirs ends here diff --git a/nsapi_shib/Makefile.am b/nsapi_shib/Makefile.am new file mode 100644 index 0000000..82c65c0 --- /dev/null +++ b/nsapi_shib/Makefile.am @@ -0,0 +1,17 @@ +AUTOMAKE_OPTIONS = foreign + +if BUILD_NSAPI +nsapi_shibdir = $(libdir)/@PACKAGE@ +nsapi_shib_LTLIBRARIES = nsapi_shib.la +nsapi_shib_la_SOURCES = nsapi_shib.cpp +nsapi_shib_la_CXXFLAGS = $(NSAPI_INCLUDE) +nsapi_shib_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +nsapi_shib_la_LIBADD = \ + $(top_builddir)/shibsp/libshibsp-lite.la + +install-exec-hook: + for la in $(nsapi_shib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(nsapi_shibdir)/$$la ; done + +endif + +EXTRA_DIST = nsapi_shib.vcproj resource.h nsapi_shib.rc nsapi_shib.cpp diff --git a/nsapi_shib/Makefile.in b/nsapi_shib/Makefile.in new file mode 100644 index 0000000..01dbbf2 --- /dev/null +++ b/nsapi_shib/Makefile.in @@ -0,0 +1,571 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = nsapi_shib +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(nsapi_shibdir)" +nsapi_shibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(nsapi_shib_LTLIBRARIES) +@BUILD_NSAPI_TRUE@nsapi_shib_la_DEPENDENCIES = \ +@BUILD_NSAPI_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la +am__nsapi_shib_la_SOURCES_DIST = nsapi_shib.cpp +@BUILD_NSAPI_TRUE@am_nsapi_shib_la_OBJECTS = \ +@BUILD_NSAPI_TRUE@ nsapi_shib_la-nsapi_shib.lo +nsapi_shib_la_OBJECTS = $(am_nsapi_shib_la_OBJECTS) +@BUILD_NSAPI_TRUE@am_nsapi_shib_la_rpath = -rpath $(nsapi_shibdir) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(nsapi_shib_la_SOURCES) +DIST_SOURCES = $(am__nsapi_shib_la_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +@BUILD_NSAPI_TRUE@nsapi_shibdir = $(libdir)/@PACKAGE@ +@BUILD_NSAPI_TRUE@nsapi_shib_LTLIBRARIES = nsapi_shib.la +@BUILD_NSAPI_TRUE@nsapi_shib_la_SOURCES = nsapi_shib.cpp +@BUILD_NSAPI_TRUE@nsapi_shib_la_CXXFLAGS = $(NSAPI_INCLUDE) +@BUILD_NSAPI_TRUE@nsapi_shib_la_LDFLAGS = $(LITE_LIBS) -module -avoid-version +@BUILD_NSAPI_TRUE@nsapi_shib_la_LIBADD = \ +@BUILD_NSAPI_TRUE@ $(top_builddir)/shibsp/libshibsp-lite.la + +EXTRA_DIST = nsapi_shib.vcproj resource.h nsapi_shib.rc nsapi_shib.cpp +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign nsapi_shib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign nsapi_shib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-nsapi_shibLTLIBRARIES: $(nsapi_shib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(nsapi_shibdir)" || $(mkdir_p) "$(DESTDIR)$(nsapi_shibdir)" + @list='$(nsapi_shib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(nsapi_shibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(nsapi_shibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(nsapi_shibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(nsapi_shibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-nsapi_shibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(nsapi_shib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(nsapi_shibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(nsapi_shibdir)/$$p"; \ + done + +clean-nsapi_shibLTLIBRARIES: + -test -z "$(nsapi_shib_LTLIBRARIES)" || rm -f $(nsapi_shib_LTLIBRARIES) + @list='$(nsapi_shib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +nsapi_shib.la: $(nsapi_shib_la_OBJECTS) $(nsapi_shib_la_DEPENDENCIES) + $(CXXLINK) $(am_nsapi_shib_la_rpath) $(nsapi_shib_la_LDFLAGS) $(nsapi_shib_la_OBJECTS) $(nsapi_shib_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsapi_shib_la-nsapi_shib.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +nsapi_shib_la-nsapi_shib.lo: nsapi_shib.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nsapi_shib_la_CXXFLAGS) $(CXXFLAGS) -MT nsapi_shib_la-nsapi_shib.lo -MD -MP -MF "$(DEPDIR)/nsapi_shib_la-nsapi_shib.Tpo" -c -o nsapi_shib_la-nsapi_shib.lo `test -f 'nsapi_shib.cpp' || echo '$(srcdir)/'`nsapi_shib.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/nsapi_shib_la-nsapi_shib.Tpo" "$(DEPDIR)/nsapi_shib_la-nsapi_shib.Plo"; else rm -f "$(DEPDIR)/nsapi_shib_la-nsapi_shib.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='nsapi_shib.cpp' object='nsapi_shib_la-nsapi_shib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nsapi_shib_la_CXXFLAGS) $(CXXFLAGS) -c -o nsapi_shib_la-nsapi_shib.lo `test -f 'nsapi_shib.cpp' || echo '$(srcdir)/'`nsapi_shib.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(nsapi_shibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@BUILD_NSAPI_FALSE@install-exec-hook: +clean: clean-am + +clean-am: clean-generic clean-libtool clean-nsapi_shibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-nsapi_shibLTLIBRARIES + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-nsapi_shibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-nsapi_shibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-exec-hook install-info install-info-am \ + install-man install-nsapi_shibLTLIBRARIES install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-nsapi_shibLTLIBRARIES + + +@BUILD_NSAPI_TRUE@install-exec-hook: +@BUILD_NSAPI_TRUE@ for la in $(nsapi_shib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(nsapi_shibdir)/$$la ; done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/nsapi_shib/nsapi_shib.cpp b/nsapi_shib/nsapi_shib.cpp new file mode 100644 index 0000000..d1efdc4 --- /dev/null +++ b/nsapi_shib/nsapi_shib.cpp @@ -0,0 +1,600 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * nsapi_shib.cpp + * + * Shibboleth NSAPI filter + */ + +#define SHIBSP_LITE + +#if defined (_MSC_VER) || defined(__BORLANDC__) +# include "config_win32.h" +#else +# include "config.h" +#endif + +#ifdef WIN32 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef WIN32 +# include +# define XP_WIN32 +#else +# define XP_UNIX +#endif + +#define MCC_HTTPD +#define NET_SSL + +extern "C" +{ +#include +} + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +// macros to output text to client +#define NET_WRITE(str) \ + if (IO_ERROR==net_write(sn->csd,str,strlen(str))) return REQ_EXIT + +namespace { + SPConfig* g_Config=NULL; + string g_ServerName; + string g_ServerScheme; + string g_unsetHeaderValue; + bool g_checkSpoofing = true; + bool g_catchAll = false; + + static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); + static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); +} + +PluginManager::Factory SunRequestMapFactory; + +extern "C" NSAPI_PUBLIC void nsapi_shib_exit(void*) +{ + if (g_Config) + g_Config->term(); + g_Config = NULL; +} + +extern "C" NSAPI_PUBLIC int nsapi_shib_init(pblock* pb, ::Session* sn, Request* rq) +{ + // Save off a default hostname for this virtual server. + char* name=pblock_findval("server-name",pb); + if (name) + g_ServerName=name; + else { + name=server_hostname; + if (name) + g_ServerName=name; + else { + name=util_hostname(); + if (name) { + g_ServerName=name; + FREE(name); + } + else { + pblock_nvinsert("error","unable to determine web server hostname",pb); + return REQ_ABORTED; + } + } + } + name=pblock_findval("server-scheme",pb); + if (name) + g_ServerScheme=name; + + log_error(LOG_INFORM,"nsapi_shib_init",sn,rq,"nsapi_shib loaded for host (%s)",g_ServerName.c_str()); + + const char* schemadir=pblock_findval("shib-schemas",pb); + const char* prefix=pblock_findval("shib-prefix",pb); + + g_Config=&SPConfig::getConfig(); + g_Config->setFeatures( + SPConfig::Listener | + SPConfig::Caching | + SPConfig::RequestMapping | + SPConfig::InProcess | + SPConfig::Logging | + SPConfig::Handlers + ); + if (!g_Config->init(schemadir,prefix)) { + g_Config=NULL; + pblock_nvinsert("error","unable to initialize Shibboleth libraries",pb); + return REQ_ABORTED; + } + + g_Config->RequestMapperManager.registerFactory(XML_REQUEST_MAPPER,&SunRequestMapFactory); + + const char* config=pblock_findval("shib-config",pb); + if (!config) + config=getenv("SHIBSP_CONFIG"); + if (!config) + config=SHIBSP_CONFIG; + + try { + xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(config); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + g_Config->getServiceProvider()->init(); + } + catch (exception& ex) { + pblock_nvinsert("error",ex.what(),pb); + g_Config->term(); + g_Config=NULL; + return REQ_ABORTED; + } + + daemon_atrestart(nsapi_shib_exit,NULL); + + ServiceProvider* sp=g_Config->getServiceProvider(); + Locker locker(sp); + const PropertySet* props=sp->getPropertySet("Local"); + if (props) { + pair unsetValue=props->getString("unsetHeaderValue"); + if (unsetValue.first) + g_unsetHeaderValue = unsetValue.second; + pair flag=props->getBool("checkSpoofing"); + g_checkSpoofing = !flag.first || flag.second; + flag=props->getBool("catchAll"); + g_catchAll = flag.first && flag.second; + } + return REQ_PROCEED; +} + +/********************************************************************************/ +// NSAPI Shib Target Subclass + +class ShibTargetNSAPI : public AbstractSPRequest +{ + mutable string m_body; + mutable bool m_gotBody,m_firsttime; + mutable vector m_certs; + set m_allhttp; + +public: + pblock* m_pb; + ::Session* m_sn; + Request* m_rq; + + ShibTargetNSAPI(pblock* pb, ::Session* sn, Request* rq) + : AbstractSPRequest(SHIBSP_LOGCAT".NSAPI"), m_gotBody(false), m_firsttime(true), m_pb(pb), m_sn(sn), m_rq(rq) { + + const char* uri=pblock_findval("uri", rq->reqpb); + const char* qstr=pblock_findval("query", rq->reqpb); + + if (qstr) { + string temp = string(uri) + '?' + qstr; + setRequestURI(temp.c_str()); + } + else { + setRequestURI(uri); + } + + // See if this is the first time we've run. + qstr = pblock_findval("auth-type", rq->vars); + if (qstr && !strcmp(qstr, "shibboleth")) + m_firsttime = false; + if (!m_firsttime || rq->orig_rq) + log(SPDebug, "nsapi_shib function running more than once"); + } + ~ShibTargetNSAPI() { } + + const char* getScheme() const { + return security_active ? "https" : "http"; + } + const char* getHostname() const { +#ifdef vs_is_default_vs + // This is 6.0 or later, so we can distinguish requests to name-based vhosts. + if (!vs_is_default_vs(request_get_vs(m_rq))) + // The beauty here is, a non-default vhost can *only* be accessed if the client + // specified the exact name in the Host header. So we can trust the Host header. + return pblock_findval("host", m_rq->headers); + else +#endif + // In other cases, we're going to rely on the initialization process... + return g_ServerName.c_str(); + } + int getPort() const { + return server_portnum; + } + const char* getMethod() const { + return pblock_findval("method", m_rq->reqpb); + } + string getContentType() const { + char* content_type = ""; + request_header("content-type", &content_type, m_sn, m_rq); + return content_type; + } + long getContentLength() const { + if (m_gotBody) + return m_body.length(); + char* content_length=""; + request_header("content-length", &content_length, m_sn, m_rq); + return atoi(content_length); + } + string getRemoteAddr() const { + return pblock_findval("ip", m_sn->client); + } + void log(SPLogLevel level, const string& msg) const { + AbstractSPRequest::log(level,msg); + if (level>=SPError) + log_error(LOG_FAILURE, "nsapi_shib", m_sn, m_rq, const_cast(msg.c_str())); + } + const char* getQueryString() const { + return pblock_findval("query", m_rq->reqpb); + } + const char* getRequestBody() const { + if (m_gotBody) + return m_body.c_str(); + char* content_length=NULL; + if (request_header("content-length", &content_length, m_sn, m_rq)!=REQ_PROCEED || atoi(content_length) > 1024*1024) // 1MB? + throw opensaml::SecurityPolicyException("Blocked request body exceeding 1M size limit."); + else { + char ch=IO_EOF+1; + int cl=atoi(content_length); + m_gotBody=true; + while (cl && ch != IO_EOF) { + ch=netbuf_getc(m_sn->inbuf); + // Check for error. + if(ch==IO_ERROR) + break; + m_body += ch; + cl--; + } + if (cl) + throw IOException("Error reading request body from browser."); + return m_body.c_str(); + } + } + void clearHeader(const char* rawname, const char* cginame) { + if (g_checkSpoofing && m_firsttime && !m_rq->orig_rq) { + if (m_allhttp.empty()) { + // Populate the set of client-supplied headers for spoof checking. + const pb_entry* entry; + for (int i=0; iheaders->hsize; ++i) { + entry = m_rq->headers->ht[i]; + while (entry) { + string cgiversion("HTTP_"); + const char* pch = entry->param->name; + while (*pch) { + cgiversion += (isalnum(*pch) ? toupper(*pch) : '_'); + pch++; + } + m_allhttp.insert(cgiversion); + entry = entry->next; + } + } + } + if (m_allhttp.count(cginame) > 0) + throw opensaml::SecurityPolicyException("Attempt to spoof header ($1) was detected.", params(1, rawname)); + } + param_free(pblock_remove(rawname, m_rq->headers)); + pblock_nvinsert(rawname, g_unsetHeaderValue.c_str(), m_rq->headers); + } + void setHeader(const char* name, const char* value) { + param_free(pblock_remove(name, m_rq->headers)); + pblock_nvinsert(name, value, m_rq->headers); + } + string getHeader(const char* name) const { + // NSAPI headers tend to be lower case. We'll special case "cookie" since it's used a lot. + char* hdr = NULL; + int cookie = strcmp(name, "Cookie"); + if (cookie == 0) + name = "cookie"; + if (request_header(const_cast(name), &hdr, m_sn, m_rq) != REQ_PROCEED) { + // We didn't get a hit, so we'll try a lower-casing operation, unless we already did... + if (cookie == 0) + return ""; + string n; + while (*name) + n += tolower(*(name++)); + if (request_header(const_cast(n.c_str()), &hdr, m_sn, m_rq) != REQ_PROCEED) + return ""; + } + return string(hdr ? hdr : ""); + } + void setRemoteUser(const char* user) { + pblock_nvinsert("auth-user", user, m_rq->vars); + } + string getRemoteUser() const { + const char* ru = pblock_findval("auth-user", m_rq->vars); + return ru ? ru : ""; + } + void setResponseHeader(const char* name, const char* value) { + pblock_nvinsert(name, value, m_rq->srvhdrs); + } + + long sendResponse(istream& in, long status) { + string msg; + char buf[1024]; + while (in) { + in.read(buf,1024); + msg.append(buf,in.gcount()); + } + pblock_nvinsert("connection","close",m_rq->srvhdrs); + pblock_nninsert("content-length", msg.length(), m_rq->srvhdrs); + protocol_status(m_sn, m_rq, status, NULL); + protocol_start_response(m_sn, m_rq); + net_write(m_sn->csd,const_cast(msg.c_str()),msg.length()); + return REQ_EXIT; + } + long sendRedirect(const char* url) { + param_free(pblock_remove("content-type", m_rq->srvhdrs)); + pblock_nninsert("content-length", 0, m_rq->srvhdrs); + pblock_nvinsert("expires", "01-Jan-1997 12:00:00 GMT", m_rq->srvhdrs); + pblock_nvinsert("cache-control", "private,no-store,no-cache", m_rq->srvhdrs); + pblock_nvinsert("location", url, m_rq->srvhdrs); + pblock_nvinsert("connection","close",m_rq->srvhdrs); + protocol_status(m_sn, m_rq, PROTOCOL_REDIRECT, NULL); + protocol_start_response(m_sn, m_rq); + return REQ_ABORTED; + } + long returnDecline() { return REQ_NOACTION; } + long returnOK() { return REQ_PROCEED; } + const vector& getClientCertificates() const { + if (m_certs.empty()) { + const char* cert = pblock_findval("auth-cert", m_rq->vars); + if (cert) + m_certs.push_back(cert); + } + return m_certs; + } +}; + +/********************************************************************************/ + +int WriteClientError(::Session* sn, Request* rq, char* func, char* msg) +{ + log_error(LOG_FAILURE,func,sn,rq,msg); + protocol_status(sn,rq,PROTOCOL_SERVER_ERROR,msg); + return REQ_ABORTED; +} + +#undef FUNC +#define FUNC "shibboleth" +extern "C" NSAPI_PUBLIC int nsapi_shib(pblock* pb, ::Session* sn, Request* rq) +{ + ostringstream threadid; + threadid << "[" << getpid() << "] nsapi_shib" << '\0'; + xmltooling::NDC ndc(threadid.str().c_str()); + + try { + ShibTargetNSAPI stn(pb, sn, rq); + + // Check user authentication + pair res = stn.getServiceProvider().doAuthentication(stn); + if (res.first) return (int)res.second; + + // user authN was okay -- export the assertions now + param_free(pblock_remove("auth-user",rq->vars)); + // This seems to be required in order to eventually set + // the auth-user var. + pblock_nvinsert("auth-type","shibboleth",rq->vars); + res = stn.getServiceProvider().doExport(stn); + if (res.first) return (int)res.second; + + // Check the Authorization + res = stn.getServiceProvider().doAuthorization(stn); + if (res.first) return (int)res.second; + + // this user is ok. + return REQ_PROCEED; + } + catch (exception& e) { + log_error(LOG_FAILURE,FUNC,sn,rq,const_cast(e.what())); + return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an exception, see web server log for error."); + } + catch (...) { + log_error(LOG_FAILURE,FUNC,sn,rq,const_cast("Shibboleth module threw an unknown exception.")); + if (g_catchAll) + return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an unknown exception."); + throw; + } +} + + +#undef FUNC +#define FUNC "shib_handler" +extern "C" NSAPI_PUBLIC int shib_handler(pblock* pb, ::Session* sn, Request* rq) +{ + ostringstream threadid; + threadid << "[" << getpid() << "] shib_handler" << '\0'; + xmltooling::NDC ndc(threadid.str().c_str()); + + try { + ShibTargetNSAPI stn(pb, sn, rq); + + pair res = stn.getServiceProvider().doHandler(stn); + if (res.first) return (int)res.second; + + return WriteClientError(sn, rq, FUNC, "Shibboleth handler did not do anything."); + } + catch (exception& e) { + log_error(LOG_FAILURE,FUNC,sn,rq,const_cast(e.what())); + return WriteClientError(sn, rq, FUNC, "Shibboleth handler threw an exception, see web server log for error."); + } + catch (...) { + if (g_catchAll) + return WriteClientError(sn, rq, FUNC, "Shibboleth handler threw an unknown exception."); + throw; + } +} + + +class SunRequestMapper : public virtual RequestMapper, public virtual PropertySet +{ +public: + SunRequestMapper(const xercesc::DOMElement* e); + ~SunRequestMapper() { delete m_mapper; delete m_stKey; delete m_propsKey; } + Lockable* lock() { return m_mapper->lock(); } + void unlock() { m_stKey->setData(NULL); m_propsKey->setData(NULL); m_mapper->unlock(); } + Settings getSettings(const HTTPRequest& request) const; + + const PropertySet* getParent() const { return NULL; } + void setParent(const PropertySet*) {} + pair getBool(const char* name, const char* ns=NULL) const; + pair getString(const char* name, const char* ns=NULL) const; + pair getXMLString(const char* name, const char* ns=NULL) const; + pair getUnsignedInt(const char* name, const char* ns=NULL) const; + pair getInt(const char* name, const char* ns=NULL) const; + void getAll(map& properties) const; + const PropertySet* getPropertySet(const char* name, const char* ns=shibspconstants::ASCII_SHIB2SPCONFIG_NS) const; + const xercesc::DOMElement* getElement() const; + +private: + RequestMapper* m_mapper; + ThreadKey* m_stKey; + ThreadKey* m_propsKey; +}; + +RequestMapper* SunRequestMapFactory(const xercesc::DOMElement* const & e) +{ + return new SunRequestMapper(e); +} + +SunRequestMapper::SunRequestMapper(const xercesc::DOMElement* e) : m_mapper(NULL), m_stKey(NULL), m_propsKey(NULL) +{ + m_mapper = SPConfig::getConfig().RequestMapperManager.newPlugin(XML_REQUEST_MAPPER,e); + m_stKey=ThreadKey::create(NULL); + m_propsKey=ThreadKey::create(NULL); +} + +RequestMapper::Settings SunRequestMapper::getSettings(const HTTPRequest& request) const +{ + Settings s=m_mapper->getSettings(request); + m_stKey->setData((void*)dynamic_cast(&request)); + m_propsKey->setData((void*)s.first); + return pair(this,s.second); +} + +pair SunRequestMapper::getBool(const char* name, const char* ns) const +{ + const ShibTargetNSAPI* stn=reinterpret_cast(m_stKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (stn && !ns && name) { + // Override boolean properties. + const char* param=pblock_findval(name,stn->m_pb); + if (param && (!strcmp(param,"1") || !strcasecmp(param,"true"))) + return make_pair(true,true); + } + return s ? s->getBool(name,ns) : make_pair(false,false); +} + +pair SunRequestMapper::getString(const char* name, const char* ns) const +{ + const ShibTargetNSAPI* stn=reinterpret_cast(m_stKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (stn && !ns && name) { + // Override string properties. + if (!strcmp(name,"authType")) + return pair(true,"shibboleth"); + else { + const char* param=pblock_findval(name,stn->m_pb); + if (param) + return make_pair(true,param); + } + } + return s ? s->getString(name,ns) : pair(false,NULL); +} + +pair SunRequestMapper::getXMLString(const char* name, const char* ns) const +{ + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + return s ? s->getXMLString(name,ns) : pair(false,NULL); +} + +pair SunRequestMapper::getUnsignedInt(const char* name, const char* ns) const +{ + const ShibTargetNSAPI* stn=reinterpret_cast(m_stKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (stn && !ns && name) { + // Override int properties. + const char* param=pblock_findval(name,stn->m_pb); + if (param) + return pair(true,strtol(param,NULL,10)); + } + return s ? s->getUnsignedInt(name,ns) : pair(false,0); +} + +pair SunRequestMapper::getInt(const char* name, const char* ns) const +{ + const ShibTargetNSAPI* stn=reinterpret_cast(m_stKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (stn && !ns && name) { + // Override int properties. + const char* param=pblock_findval(name,stn->m_pb); + if (param) + return pair(true,atoi(param)); + } + return s ? s->getInt(name,ns) : pair(false,0); +} + +void SunRequestMapper::getAll(map& properties) const +{ + const ShibTargetNSAPI* stn=reinterpret_cast(m_stKey->getData()); + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + if (s) + s->getAll(properties); + if (!stn) + return; + properties["authType"] = "shibboleth"; + const pb_entry* entry; + for (int i=0; im_pb->hsize; ++i) { + entry = stn->m_pb->ht[i]; + while (entry) { + properties[entry->param->name] = entry->param->value; + entry = entry->next; + } + } +} + +const PropertySet* SunRequestMapper::getPropertySet(const char* name, const char* ns) const +{ + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + return s ? s->getPropertySet(name,ns) : NULL; +} + +const xercesc::DOMElement* SunRequestMapper::getElement() const +{ + const PropertySet* s=reinterpret_cast(m_propsKey->getData()); + return s ? s->getElement() : NULL; +} diff --git a/nsapi_shib/nsapi_shib.rc b/nsapi_shib/nsapi_shib.rc new file mode 100644 index 0000000..1c41f3d --- /dev/null +++ b/nsapi_shib/nsapi_shib.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth NSAPI Extension\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "nsapi_shib\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "nsapi_shib.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/nsapi_shib/nsapi_shib.vcproj b/nsapi_shib/nsapi_shib.vcproj new file mode 100644 index 0000000..8251b79 --- /dev/null +++ b/nsapi_shib/nsapi_shib.vcproj @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nsapi_shib/resource.h b/nsapi_shib/resource.h new file mode 100644 index 0000000..70749e6 --- /dev/null +++ b/nsapi_shib/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by nsapi_shib.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/odbc-store/Makefile.am b/odbc-store/Makefile.am new file mode 100644 index 0000000..c18fe5b --- /dev/null +++ b/odbc-store/Makefile.am @@ -0,0 +1,20 @@ +AUTOMAKE_OPTIONS = foreign + +plugindir = $(libdir)/@PACKAGE@ +plugin_LTLIBRARIES = odbc-store.la + +AM_CFLAGS = $(ODBC_CFLAGS) +AM_CXXFLAGS = $(ODBC_CFLAGS) + +odbc_store_la_LIBADD = \ + $(ODBC_LIBS) + +odbc_store_la_SOURCES = \ + odbc-store.cpp + +odbc_store_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS) + +install-exec-hook: + for la in $(plugin_LTLIBRARIES) ; do rm -f $(DESTDIR)$(plugindir)/$$la ; done + +EXTRA_DIST = odbc-store.vcproj odbc-store.rc resource.h diff --git a/odbc-store/Makefile.in b/odbc-store/Makefile.in new file mode 100644 index 0000000..c61af5f --- /dev/null +++ b/odbc-store/Makefile.in @@ -0,0 +1,563 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = odbc-store +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(plugindir)" +pluginLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(plugin_LTLIBRARIES) +am__DEPENDENCIES_1 = +odbc_store_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_odbc_store_la_OBJECTS = odbc-store.lo +odbc_store_la_OBJECTS = $(am_odbc_store_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(odbc_store_la_SOURCES) +DIST_SOURCES = $(odbc_store_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +plugindir = $(libdir)/@PACKAGE@ +plugin_LTLIBRARIES = odbc-store.la +AM_CFLAGS = $(ODBC_CFLAGS) +AM_CXXFLAGS = $(ODBC_CFLAGS) +odbc_store_la_LIBADD = \ + $(ODBC_LIBS) + +odbc_store_la_SOURCES = \ + odbc-store.cpp + +odbc_store_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS) +EXTRA_DIST = odbc-store.vcproj odbc-store.rc resource.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign odbc-store/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign odbc-store/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(plugindir)" || $(mkdir_p) "$(DESTDIR)$(plugindir)" + @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(plugindir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$p"; \ + done + +clean-pluginLTLIBRARIES: + -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) + @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +odbc-store.la: $(odbc_store_la_OBJECTS) $(odbc_store_la_DEPENDENCIES) + $(CXXLINK) -rpath $(plugindir) $(odbc_store_la_LDFLAGS) $(odbc_store_la_OBJECTS) $(odbc_store_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odbc-store.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(plugindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginLTLIBRARIES + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pluginLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-exec-hook install-info install-info-am \ + install-man install-pluginLTLIBRARIES install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-pluginLTLIBRARIES + + +install-exec-hook: + for la in $(plugin_LTLIBRARIES) ; do rm -f $(DESTDIR)$(plugindir)/$$la ; done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/odbc-store/odbc-store.cpp b/odbc-store/odbc-store.cpp new file mode 100644 index 0000000..f64f091 --- /dev/null +++ b/odbc-store/odbc-store.cpp @@ -0,0 +1,866 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * odbc-store.cpp + * + * Storage Service using ODBC + */ + +#if defined (_MSC_VER) || defined(__BORLANDC__) +# include "config_win32.h" +#else +# include "config.h" +#endif + +#ifdef WIN32 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#ifdef WIN32 +# define ODBCSTORE_EXPORTS __declspec(dllexport) +#else +# define ODBCSTORE_EXPORTS +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace xmltooling::logging; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +#define PLUGIN_VER_MAJOR 1 +#define PLUGIN_VER_MINOR 0 + +#define LONGDATA_BUFLEN 16384 + +#define COLSIZE_CONTEXT 255 +#define COLSIZE_ID 255 +#define COLSIZE_STRING_VALUE 255 + +#define STRING_TABLE "strings" +#define TEXT_TABLE "texts" + +/* table definitions +CREATE TABLE version ( + major tinyint NOT NULL, + minor tinyint NOT NULL + ) + +CREATE TABLE strings ( + context varchar(255) not null, + id varchar(255) not null, + expires datetime not null, + version smallint not null, + value varchar(255) not null, + PRIMARY KEY (context, id) + ) + +CREATE TABLE texts ( + context varchar(255) not null, + id varchar(255) not null, + expires datetime not null, + version smallint not null, + value text not null, + PRIMARY KEY (context, id) + ) +*/ + +namespace { + static const XMLCh cleanupInterval[] = UNICODE_LITERAL_15(c,l,e,a,n,u,p,I,n,t,e,r,v,a,l); + static const XMLCh isolationLevel[] = UNICODE_LITERAL_14(i,s,o,l,a,t,i,o,n,L,e,v,e,l); + static const XMLCh ConnectionString[] = UNICODE_LITERAL_16(C,o,n,n,e,c,t,i,o,n,S,t,r,i,n,g); + static const XMLCh RetryOnError[] = UNICODE_LITERAL_12(R,e,t,r,y,O,n,E,r,r,o,r); + + // RAII for ODBC handles + struct ODBCConn { + ODBCConn(SQLHDBC conn) : handle(conn), autoCommit(true) {} + ~ODBCConn() { + SQLRETURN sr = SQL_SUCCESS; + if (!autoCommit) + sr = SQLSetConnectAttr(handle, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_ON, NULL); + SQLDisconnect(handle); + SQLFreeHandle(SQL_HANDLE_DBC,handle); + if (!SQL_SUCCEEDED(sr)) + throw IOException("Failed to commit connection and return to auto-commit mode."); + } + operator SQLHDBC() {return handle;} + SQLHDBC handle; + bool autoCommit; + }; + + class ODBCStorageService : public StorageService + { + public: + ODBCStorageService(const DOMElement* e); + virtual ~ODBCStorageService(); + + bool createString(const char* context, const char* key, const char* value, time_t expiration) { + return createRow(STRING_TABLE, context, key, value, expiration); + } + int readString(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0) { + return readRow(STRING_TABLE, context, key, pvalue, pexpiration, version, false); + } + int updateString(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0) { + return updateRow(STRING_TABLE, context, key, value, expiration, version); + } + bool deleteString(const char* context, const char* key) { + return deleteRow(STRING_TABLE, context, key); + } + + bool createText(const char* context, const char* key, const char* value, time_t expiration) { + return createRow(TEXT_TABLE, context, key, value, expiration); + } + int readText(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0) { + return readRow(TEXT_TABLE, context, key, pvalue, pexpiration, version, true); + } + int updateText(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0) { + return updateRow(TEXT_TABLE, context, key, value, expiration, version); + } + bool deleteText(const char* context, const char* key) { + return deleteRow(TEXT_TABLE, context, key); + } + + void reap(const char* context) { + reap(STRING_TABLE, context); + reap(TEXT_TABLE, context); + } + + void updateContext(const char* context, time_t expiration) { + updateContext(STRING_TABLE, context, expiration); + updateContext(TEXT_TABLE, context, expiration); + } + + void deleteContext(const char* context) { + deleteContext(STRING_TABLE, context); + deleteContext(TEXT_TABLE, context); + } + + + private: + bool createRow(const char *table, const char* context, const char* key, const char* value, time_t expiration); + int readRow(const char *table, const char* context, const char* key, string* pvalue, time_t* pexpiration, int version, bool text); + int updateRow(const char *table, const char* context, const char* key, const char* value, time_t expiration, int version); + bool deleteRow(const char *table, const char* context, const char* key); + + void reap(const char* table, const char* context); + void updateContext(const char* table, const char* context, time_t expiration); + void deleteContext(const char* table, const char* context); + + SQLHDBC getHDBC(); + SQLHSTMT getHSTMT(SQLHDBC); + pair getVersion(SQLHDBC); + pair log_error(SQLHANDLE handle, SQLSMALLINT htype, const char* checkfor=NULL); + + static void* cleanup_fn(void*); + void cleanup(); + + Category& m_log; + int m_cleanupInterval; + CondWait* shutdown_wait; + Thread* cleanup_thread; + bool shutdown; + + SQLHENV m_henv; + string m_connstring; + long m_isolation; + vector m_retries; + }; + + StorageService* ODBCStorageServiceFactory(const DOMElement* const & e) + { + return new ODBCStorageService(e); + } + + // convert SQL timestamp to time_t + time_t timeFromTimestamp(SQL_TIMESTAMP_STRUCT expires) + { + time_t ret; + struct tm t; + t.tm_sec=expires.second; + t.tm_min=expires.minute; + t.tm_hour=expires.hour; + t.tm_mday=expires.day; + t.tm_mon=expires.month-1; + t.tm_year=expires.year-1900; + t.tm_isdst=0; +#if defined(HAVE_TIMEGM) + ret = timegm(&t); +#else + ret = mktime(&t) - timezone; +#endif + return (ret); + } + + // conver time_t to SQL string + void timestampFromTime(time_t t, char* ret) + { +#ifdef HAVE_GMTIME_R + struct tm res; + struct tm* ptime=gmtime_r(&t,&res); +#else + struct tm* ptime=gmtime(&t); +#endif + strftime(ret,32,"{ts '%Y-%m-%d %H:%M:%S'}",ptime); + } + + // make a string safe for SQL command + // result to be free'd only if it isn't the input + static char *makeSafeSQL(const char *src) + { + int ns = 0; + int nc = 0; + char *s; + + // see if any conversion needed + for (s=(char*)src; *s; nc++,s++) if (*s=='\'') ns++; + if (ns==0) return ((char*)src); + + char *safe = new char[(nc+2*ns+1)]; + for (s=safe; *src; src++) { + if (*src=='\'') *s++ = '\''; + *s++ = (char)*src; + } + *s = '\0'; + return (safe); + } + + void freeSafeSQL(char *safe, const char *src) + { + if (safe!=src) + delete[](safe); + } +}; + +ODBCStorageService::ODBCStorageService(const DOMElement* e) : m_log(Category::getInstance("XMLTooling.StorageService")), + m_cleanupInterval(900), shutdown_wait(NULL), cleanup_thread(NULL), shutdown(false), m_henv(SQL_NULL_HANDLE), m_isolation(SQL_TXN_SERIALIZABLE) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("ODBCStorageService"); +#endif + + const XMLCh* tag=e ? e->getAttributeNS(NULL,cleanupInterval) : NULL; + if (tag && *tag) + m_cleanupInterval = XMLString::parseInt(tag); + if (!m_cleanupInterval) + m_cleanupInterval = 900; + + auto_ptr_char iso(e ? e->getAttributeNS(NULL,isolationLevel) : NULL); + if (iso.get() && *iso.get()) { + if (!strcmp(iso.get(),"SERIALIZABLE")) + m_isolation = SQL_TXN_SERIALIZABLE; + else if (!strcmp(iso.get(),"REPEATABLE_READ")) + m_isolation = SQL_TXN_REPEATABLE_READ; + else if (!strcmp(iso.get(),"READ_COMMITTED")) + m_isolation = SQL_TXN_READ_COMMITTED; + else if (!strcmp(iso.get(),"READ_UNCOMMITTED")) + m_isolation = SQL_TXN_READ_UNCOMMITTED; + else + throw XMLToolingException("Unknown transaction isolationLevel property."); + } + + if (m_henv == SQL_NULL_HANDLE) { + // Enable connection pooling. + SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0); + + // Allocate the environment. + if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_henv))) + throw XMLToolingException("ODBC failed to initialize."); + + // Specify ODBC 3.x + SQLSetEnvAttr(m_henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); + + m_log.info("ODBC initialized"); + } + + // Grab connection string from the configuration. + e = e ? XMLHelper::getFirstChildElement(e,ConnectionString) : NULL; + if (!e || !e->hasChildNodes()) { + SQLFreeHandle(SQL_HANDLE_ENV, m_henv); + throw XMLToolingException("ODBC StorageService requires ConnectionString element in configuration."); + } + auto_ptr_char arg(e->getFirstChild()->getNodeValue()); + m_connstring=arg.get(); + + // Connect and check version. + ODBCConn conn(getHDBC()); + pair v=getVersion(conn); + + // Make sure we've got the right version. + if (v.first != PLUGIN_VER_MAJOR) { + SQLFreeHandle(SQL_HANDLE_ENV, m_henv); + m_log.crit("unknown database version: %d.%d", v.first, v.second); + throw XMLToolingException("Unknown database version for ODBC StorageService."); + } + + // Load any retry errors to check. + e = XMLHelper::getNextSiblingElement(e,RetryOnError); + while (e) { + if (e->hasChildNodes()) { + m_retries.push_back(XMLString::parseInt(e->getFirstChild()->getNodeValue())); + m_log.info("will retry operations when native ODBC error (%ld) is returned", m_retries.back()); + } + e = XMLHelper::getNextSiblingElement(e,RetryOnError); + } + + // Initialize the cleanup thread + shutdown_wait = CondWait::create(); + cleanup_thread = Thread::create(&cleanup_fn, (void*)this); +} + +ODBCStorageService::~ODBCStorageService() +{ + shutdown = true; + shutdown_wait->signal(); + cleanup_thread->join(NULL); + delete shutdown_wait; + if (m_henv != SQL_NULL_HANDLE) + SQLFreeHandle(SQL_HANDLE_ENV, m_henv); +} + +pair ODBCStorageService::log_error(SQLHANDLE handle, SQLSMALLINT htype, const char* checkfor) +{ + SQLSMALLINT i = 0; + SQLINTEGER native; + SQLCHAR state[7]; + SQLCHAR text[256]; + SQLSMALLINT len; + SQLRETURN ret; + + pair res = make_pair(false,false); + do { + ret = SQLGetDiagRec(htype, handle, ++i, state, &native, text, sizeof(text), &len); + if (SQL_SUCCEEDED(ret)) { + m_log.error("ODBC Error: %s:%ld:%ld:%s", state, i, native, text); + for (vector::const_iterator n = m_retries.begin(); !res.first && n != m_retries.end(); ++n) + res.first = (*n == native); + if (checkfor && !strcmp(checkfor, (const char*)state)) + res.second = true; + } + } while(SQL_SUCCEEDED(ret)); + return res; +} + +SQLHDBC ODBCStorageService::getHDBC() +{ +#ifdef _DEBUG + xmltooling::NDC ndc("getHDBC"); +#endif + + // Get a handle. + SQLHDBC handle; + SQLRETURN sr=SQLAllocHandle(SQL_HANDLE_DBC, m_henv, &handle); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("failed to allocate connection handle"); + log_error(m_henv, SQL_HANDLE_ENV); + throw IOException("ODBC StorageService failed to allocate a connection handle."); + } + + sr=SQLDriverConnect(handle,NULL,(SQLCHAR*)m_connstring.c_str(),m_connstring.length(),NULL,0,NULL,SQL_DRIVER_NOPROMPT); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("failed to connect to database"); + log_error(handle, SQL_HANDLE_DBC); + throw IOException("ODBC StorageService failed to connect to database."); + } + + sr = SQLSetConnectAttr(handle, SQL_ATTR_TXN_ISOLATION, (SQLPOINTER)m_isolation, NULL); + if (!SQL_SUCCEEDED(sr)) + throw IOException("ODBC StorageService failed to set transaction isolation level."); + + return handle; +} + +SQLHSTMT ODBCStorageService::getHSTMT(SQLHDBC conn) +{ + SQLHSTMT hstmt; + SQLRETURN sr=SQLAllocHandle(SQL_HANDLE_STMT,conn,&hstmt); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("failed to allocate statement handle"); + log_error(conn, SQL_HANDLE_DBC); + throw IOException("ODBC StorageService failed to allocate a statement handle."); + } + return hstmt; +} + +pair ODBCStorageService::getVersion(SQLHDBC conn) +{ + // Grab the version number from the database. + SQLHSTMT stmt = getHSTMT(conn); + + SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)"SELECT major,minor FROM version", SQL_NTS); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("failed to read version from database"); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to read version from database."); + } + + SQLINTEGER major; + SQLINTEGER minor; + SQLBindCol(stmt,1,SQL_C_SLONG,&major,0,NULL); + SQLBindCol(stmt,2,SQL_C_SLONG,&minor,0,NULL); + + if ((sr=SQLFetch(stmt)) != SQL_NO_DATA) + return pair(major,minor); + + m_log.error("no rows returned in version query"); + throw IOException("ODBC StorageService failed to read version from database."); +} + +bool ODBCStorageService::createRow(const char* table, const char* context, const char* key, const char* value, time_t expiration) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("createRow"); +#endif + + char timebuf[32]; + timestampFromTime(expiration, timebuf); + + // Get statement handle. + ODBCConn conn(getHDBC()); + SQLHSTMT stmt = getHSTMT(conn); + + // Prepare and exectute insert statement. + //char *scontext = makeSafeSQL(context); + //char *skey = makeSafeSQL(key); + //char *svalue = makeSafeSQL(value); + string q = string("INSERT INTO ") + table + " VALUES (?,?," + timebuf + ",1,?)"; + + SQLRETURN sr = SQLPrepare(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("SQLPrepare failed (t=%s, c=%s, k=%s)", table, context, key); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to insert record."); + } + m_log.debug("SQLPrepare succeeded. SQL: %s", q.c_str()); + + SQLINTEGER b_ind = SQL_NTS; + sr = SQLBindParam(stmt, 1, SQL_C_CHAR, SQL_VARCHAR, 255, 0, const_cast(context), &b_ind); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("SQLBindParam failed (context = %s)", context); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to insert record."); + } + m_log.debug("SQLBindParam succeeded (context = %s)", context); + + sr = SQLBindParam(stmt, 2, SQL_C_CHAR, SQL_VARCHAR, 255, 0, const_cast(key), &b_ind); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("SQLBindParam failed (key = %s)", key); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to insert record."); + } + m_log.debug("SQLBindParam succeeded (key = %s)", key); + + if (strcmp(table, TEXT_TABLE)==0) + sr = SQLBindParam(stmt, 3, SQL_C_CHAR, SQL_LONGVARCHAR, strlen(value), 0, const_cast(value), &b_ind); + else + sr = SQLBindParam(stmt, 3, SQL_C_CHAR, SQL_VARCHAR, 255, 0, const_cast(value), &b_ind); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("SQLBindParam failed (value = %s)", value); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to insert record."); + } + m_log.debug("SQLBindParam succeeded (value = %s)", value); + + //freeSafeSQL(scontext, context); + //freeSafeSQL(skey, key); + //freeSafeSQL(svalue, value); + //m_log.debug("SQL: %s", q.c_str()); + + int attempts = 3; + pair logres; + do { + logres = make_pair(false,false); + attempts--; + sr=SQLExecute(stmt); + if (SQL_SUCCEEDED(sr)) { + m_log.debug("SQLExecute of insert succeeded"); + return true; + } + m_log.error("insert record failed (t=%s, c=%s, k=%s)", table, context, key); + logres = log_error(stmt, SQL_HANDLE_STMT, "23000"); + if (logres.second) + return false; // supposedly integrity violation? + } while (attempts && logres.first); + + throw IOException("ODBC StorageService failed to insert record."); +} + +int ODBCStorageService::readRow( + const char *table, const char* context, const char* key, string* pvalue, time_t* pexpiration, int version, bool text + ) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("readRow"); +#endif + + // Get statement handle. + ODBCConn conn(getHDBC()); + SQLHSTMT stmt = getHSTMT(conn); + + // Prepare and exectute select statement. + char timebuf[32]; + timestampFromTime(time(NULL), timebuf); + char *scontext = makeSafeSQL(context); + char *skey = makeSafeSQL(key); + ostringstream q; + q << "SELECT version"; + if (pexpiration) + q << ",expires"; + if (pvalue) + q << ",CASE version WHEN " << version << " THEN NULL ELSE value END"; + q << " FROM " << table << " WHERE context='" << scontext << "' AND id='" << skey << "' AND expires > " << timebuf; + freeSafeSQL(scontext, context); + freeSafeSQL(skey, key); + if (m_log.isDebugEnabled()) + m_log.debug("SQL: %s", q.str().c_str()); + + SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)q.str().c_str(), SQL_NTS); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("error searching for (t=%s, c=%s, k=%s)", table, context, key); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService search failed."); + } + + SQLSMALLINT ver; + SQL_TIMESTAMP_STRUCT expiration; + + SQLBindCol(stmt,1,SQL_C_SSHORT,&ver,0,NULL); + if (pexpiration) + SQLBindCol(stmt,2,SQL_C_TYPE_TIMESTAMP,&expiration,0,NULL); + + if ((sr=SQLFetch(stmt)) == SQL_NO_DATA) + return 0; + + if (pexpiration) + *pexpiration = timeFromTimestamp(expiration); + + if (version == ver) + return version; // nothing's changed, so just echo back the version + + if (pvalue) { + SQLINTEGER len; + SQLCHAR buf[LONGDATA_BUFLEN]; + while ((sr=SQLGetData(stmt,pexpiration ? 3 : 2,SQL_C_CHAR,buf,sizeof(buf),&len)) != SQL_NO_DATA) { + if (!SQL_SUCCEEDED(sr)) { + m_log.error("error while reading text field from result set"); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService search failed to read data from result set."); + } + pvalue->append((char*)buf); + } + } + + return ver; +} + +int ODBCStorageService::updateRow(const char *table, const char* context, const char* key, const char* value, time_t expiration, int version) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("updateRow"); +#endif + + if (!value && !expiration) + throw IOException("ODBC StorageService given invalid update instructions."); + + // Get statement handle. Disable auto-commit mode to wrap select + update. + ODBCConn conn(getHDBC()); + SQLRETURN sr = SQLSetConnectAttr(conn, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, NULL); + if (!SQL_SUCCEEDED(sr)) + throw IOException("ODBC StorageService failed to disable auto-commit mode."); + conn.autoCommit = false; + SQLHSTMT stmt = getHSTMT(conn); + + // First, fetch the current version for later, which also ensures the record still exists. + char timebuf[32]; + timestampFromTime(time(NULL), timebuf); + char *scontext = makeSafeSQL(context); + char *skey = makeSafeSQL(key); + string q("SELECT version FROM "); + q = q + table + " WHERE context='" + scontext + "' AND id='" + skey + "' AND expires > " + timebuf; + + m_log.debug("SQL: %s", q.c_str()); + + sr=SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if (!SQL_SUCCEEDED(sr)) { + freeSafeSQL(scontext, context); + freeSafeSQL(skey, key); + m_log.error("error searching for (t=%s, c=%s, k=%s)", table, context, key); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService search failed."); + } + + SQLSMALLINT ver; + SQLBindCol(stmt,1,SQL_C_SSHORT,&ver,0,NULL); + if ((sr=SQLFetch(stmt)) == SQL_NO_DATA) { + freeSafeSQL(scontext, context); + freeSafeSQL(skey, key); + return 0; + } + + // Check version? + if (version > 0 && version != ver) { + freeSafeSQL(scontext, context); + freeSafeSQL(skey, key); + return -1; + } + + SQLFreeHandle(SQL_HANDLE_STMT, stmt); + stmt = getHSTMT(conn); + + // Prepare and exectute update statement. + q = string("UPDATE ") + table + " SET "; + + if (value) + q = q + "value=?, version=version+1"; + + if (expiration) { + timestampFromTime(expiration, timebuf); + if (value) + q += ','; + q = q + "expires = " + timebuf; + } + + q = q + " WHERE context='" + scontext + "' AND id='" + skey + "'"; + freeSafeSQL(scontext, context); + freeSafeSQL(skey, key); + + sr = SQLPrepare(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("update of record failed (t=%s, c=%s, k=%s", table, context, key); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to update record."); + } + m_log.debug("SQLPrepare succeeded. SQL: %s", q.c_str()); + + SQLINTEGER b_ind = SQL_NTS; + if (value) { + if (strcmp(table, TEXT_TABLE)==0) + sr = SQLBindParam(stmt, 1, SQL_C_CHAR, SQL_LONGVARCHAR, strlen(value), 0, const_cast(value), &b_ind); + else + sr = SQLBindParam(stmt, 1, SQL_C_CHAR, SQL_VARCHAR, 255, 0, const_cast(value), &b_ind); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("SQLBindParam failed (context = %s)", context); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to update record."); + } + m_log.debug("SQLBindParam succeeded (context = %s)", context); + } + + int attempts = 3; + pair logres; + do { + logres = make_pair(false,false); + attempts--; + sr=SQLExecute(stmt); + if (sr==SQL_NO_DATA) + return 0; // went missing? + else if (SQL_SUCCEEDED(sr)) { + m_log.debug("SQLExecute of update succeeded"); + return ver + 1; + } + + m_log.error("update of record failed (t=%s, c=%s, k=%s", table, context, key); + logres = log_error(stmt, SQL_HANDLE_STMT); + } while (attempts && logres.first); + + throw IOException("ODBC StorageService failed to update record."); +} + +bool ODBCStorageService::deleteRow(const char *table, const char *context, const char* key) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("deleteRow"); +#endif + + // Get statement handle. + ODBCConn conn(getHDBC()); + SQLHSTMT stmt = getHSTMT(conn); + + // Prepare and execute delete statement. + char *scontext = makeSafeSQL(context); + char *skey = makeSafeSQL(key); + string q = string("DELETE FROM ") + table + " WHERE context='" + scontext + "' AND id='" + skey + "'"; + freeSafeSQL(scontext, context); + freeSafeSQL(skey, key); + m_log.debug("SQL: %s", q.c_str()); + + SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if (sr==SQL_NO_DATA) + return false; + else if (!SQL_SUCCEEDED(sr)) { + m_log.error("error deleting record (t=%s, c=%s, k=%s)", table, context, key); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to delete record."); + } + + return true; +} + + +void ODBCStorageService::cleanup() +{ +#ifdef _DEBUG + xmltooling::NDC ndc("cleanup"); +#endif + + Mutex* mutex = Mutex::create(); + + mutex->lock(); + + m_log.info("cleanup thread started... running every %d secs", m_cleanupInterval); + + while (!shutdown) { + shutdown_wait->timedwait(mutex, m_cleanupInterval); + if (shutdown) + break; + try { + reap(NULL); + } + catch (exception& ex) { + m_log.error("cleanup thread swallowed exception: %s", ex.what()); + } + } + + m_log.info("cleanup thread exiting..."); + + mutex->unlock(); + delete mutex; + Thread::exit(NULL); +} + +void* ODBCStorageService::cleanup_fn(void* cache_p) +{ + ODBCStorageService* cache = (ODBCStorageService*)cache_p; + +#ifndef WIN32 + // First, let's block all signals + Thread::mask_all_signals(); +#endif + + // Now run the cleanup process. + cache->cleanup(); + return NULL; +} + +void ODBCStorageService::updateContext(const char *table, const char* context, time_t expiration) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("updateContext"); +#endif + + // Get statement handle. + ODBCConn conn(getHDBC()); + SQLHSTMT stmt = getHSTMT(conn); + + char timebuf[32]; + timestampFromTime(expiration, timebuf); + + char nowbuf[32]; + timestampFromTime(time(NULL), nowbuf); + + char *scontext = makeSafeSQL(context); + string q("UPDATE "); + q = q + table + " SET expires = " + timebuf + " WHERE context='" + scontext + "' AND expires > " + nowbuf; + freeSafeSQL(scontext, context); + + m_log.debug("SQL: %s", q.c_str()); + + SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if ((sr!=SQL_NO_DATA) && !SQL_SUCCEEDED(sr)) { + m_log.error("error updating records (t=%s, c=%s)", table, context ? context : "all"); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to update context expiration."); + } +} + +void ODBCStorageService::reap(const char *table, const char* context) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("reap"); +#endif + + // Get statement handle. + ODBCConn conn(getHDBC()); + SQLHSTMT stmt = getHSTMT(conn); + + // Prepare and execute delete statement. + char nowbuf[32]; + timestampFromTime(time(NULL), nowbuf); + string q; + if (context) { + char *scontext = makeSafeSQL(context); + q = string("DELETE FROM ") + table + " WHERE context='" + scontext + "' AND expires <= " + nowbuf; + freeSafeSQL(scontext, context); + } + else { + q = string("DELETE FROM ") + table + " WHERE expires <= " + nowbuf; + } + m_log.debug("SQL: %s", q.c_str()); + + SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if ((sr!=SQL_NO_DATA) && !SQL_SUCCEEDED(sr)) { + m_log.error("error expiring records (t=%s, c=%s)", table, context ? context : "all"); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to purge expired records."); + } +} + +void ODBCStorageService::deleteContext(const char *table, const char* context) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("deleteContext"); +#endif + + // Get statement handle. + ODBCConn conn(getHDBC()); + SQLHSTMT stmt = getHSTMT(conn); + + // Prepare and execute delete statement. + char *scontext = makeSafeSQL(context); + string q = string("DELETE FROM ") + table + " WHERE context='" + scontext + "'"; + freeSafeSQL(scontext, context); + m_log.debug("SQL: %s", q.c_str()); + + SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if ((sr!=SQL_NO_DATA) && !SQL_SUCCEEDED(sr)) { + m_log.error("error deleting context (t=%s, c=%s)", table, context); + log_error(stmt, SQL_HANDLE_STMT); + throw IOException("ODBC StorageService failed to delete context."); + } +} + +extern "C" int ODBCSTORE_EXPORTS xmltooling_extension_init(void*) +{ + // Register this SS type + XMLToolingConfig::getConfig().StorageServiceManager.registerFactory("ODBC", ODBCStorageServiceFactory); + return 0; +} + +extern "C" void ODBCSTORE_EXPORTS xmltooling_extension_term() +{ + XMLToolingConfig::getConfig().StorageServiceManager.deregisterFactory("ODBC"); +} diff --git a/odbc-store/odbc-store.rc b/odbc-store/odbc-store.rc new file mode 100644 index 0000000..1a64b78 --- /dev/null +++ b/odbc-store/odbc-store.rc @@ -0,0 +1,101 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Internet2" + VALUE "FileDescription", "Shibboleth ODBC Storage Service Plugin" + VALUE "FileVersion", "2, 0, 0, 0" + VALUE "InternalName", "odbc-store" + VALUE "LegalCopyright", "Copyright (C) 2007 Internet2" + VALUE "OriginalFilename", "odbc-store.so" + VALUE "ProductName", "Shibboleth 2.0" + VALUE "ProductVersion", "2, 0, 0, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED \ No newline at end of file diff --git a/odbc-store/odbc-store.vcproj b/odbc-store/odbc-store.vcproj new file mode 100644 index 0000000..eea1ff0 --- /dev/null +++ b/odbc-store/odbc-store.vcproj @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/odbc-store/resource.h b/odbc-store/resource.h new file mode 100644 index 0000000..7a79a45 --- /dev/null +++ b/odbc-store/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by odbc-store.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/pkginfo b/pkginfo new file mode 100644 index 0000000..6e122af --- /dev/null +++ b/pkginfo @@ -0,0 +1,11 @@ +PKG=SHIBsp +VERSION=2.0 +BASEDIR=/ +NAME=shibboleth-sp +CATEGORY=application,security +DESC=Shibboleth Service Provider +VENDOR=Internet2 +HOTLINE=https://bugs.internet2.edu/ +CLASSES=none +PSTAMP=sunra.internet2.edu 2008-03-17 +EMAIL=cantor.2@osu.edu diff --git a/pkginfo.in b/pkginfo.in new file mode 100644 index 0000000..53f2469 --- /dev/null +++ b/pkginfo.in @@ -0,0 +1,11 @@ +PKG=SHIBsp +VERSION=@-VERSION-@ +BASEDIR=/ +NAME=shibboleth-sp +CATEGORY=application,security +DESC=Shibboleth Service Provider +VENDOR=Internet2 +HOTLINE=https://bugs.internet2.edu/ +CLASSES=none +PSTAMP=sunra.internet2.edu 2008-03-17 +EMAIL=cantor.2@osu.edu diff --git a/postinstall b/postinstall new file mode 100644 index 0000000..790f33f --- /dev/null +++ b/postinstall @@ -0,0 +1,34 @@ +#!/bin/sh + +cd /opt/shibboleth-sp/etc/shibboleth + +CONFIGFILES=" \ + native.logger \ + shibd.logger \ + syslog.logger \ + console.logger \ + accessError.html \ + sessionError.html \ + metadataError.html \ + sslError.html \ + bindingTemplate.html \ + discoveryTemplate.html \ + localLogout.html \ + globalLogout.html \ + attribute-map.xml \ + attribute-policy.xml \ + example-metadata.xml \ + shibboleth2.xml" + +for f in $CONFIGFILES; do + if test ! -f $f; then + cp $f.dist $f + fi; + done + +PATH=$PATH:/usr/local/bin +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib +export PATH LD_LIBRARY_PATH +sh ./keygen.sh -b + +exit 0 diff --git a/schemas/Makefile.am b/schemas/Makefile.am new file mode 100644 index 0000000..1e73766 --- /dev/null +++ b/schemas/Makefile.am @@ -0,0 +1,38 @@ +## $Id: Makefile.am 2566 2007-10-24 02:19:26Z cantor $ + +AUTOMAKE_OPTIONS = foreign + +pkgxmldir = $(datadir)/xml/@PACKAGE@ + +schemafiles = \ + shibboleth.xsd \ + shibboleth-metadata-1.0.xsd \ + shibboleth-2.0-native-sp-config.xsd \ + shibboleth-2.0-afp.xsd \ + shibboleth-2.0-afp-mf-basic.xsd \ + shibboleth-2.0-afp-mf-saml.xsd \ + shibboleth-2.0-attribute-map.xsd \ + shibboleth-2.0-sp-notify.xsd \ + WS-Trust.xsd + +pkgxml_DATA = \ + catalog.xml \ + $(schemafiles) + +# +# Some of these need building +# +do-build-file: + rm -f ${FILE}.tmp + sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \ + -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' + cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE} + rm -f ${FILE}.tmp + +catalog.xml: ${srcdir}/catalog.xml.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ + +CLEANFILES = catalog.xml + +EXTRA_DIST = catalog.xml.in \ + $(schemafiles) diff --git a/schemas/Makefile.in b/schemas/Makefile.in new file mode 100644 index 0000000..2a9dac2 --- /dev/null +++ b/schemas/Makefile.in @@ -0,0 +1,471 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = schemas +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgxmldir)" +pkgxmlDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgxml_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +pkgxmldir = $(datadir)/xml/@PACKAGE@ +schemafiles = \ + shibboleth.xsd \ + shibboleth-metadata-1.0.xsd \ + shibboleth-2.0-native-sp-config.xsd \ + shibboleth-2.0-afp.xsd \ + shibboleth-2.0-afp-mf-basic.xsd \ + shibboleth-2.0-afp-mf-saml.xsd \ + shibboleth-2.0-attribute-map.xsd \ + shibboleth-2.0-sp-notify.xsd \ + WS-Trust.xsd + +pkgxml_DATA = \ + catalog.xml \ + $(schemafiles) + +CLEANFILES = catalog.xml +EXTRA_DIST = catalog.xml.in \ + $(schemafiles) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign schemas/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign schemas/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-pkgxmlDATA: $(pkgxml_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgxmldir)" || $(mkdir_p) "$(DESTDIR)$(pkgxmldir)" + @list='$(pkgxml_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgxmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgxmldir)/$$f'"; \ + $(pkgxmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgxmldir)/$$f"; \ + done + +uninstall-pkgxmlDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgxml_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgxmldir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgxmldir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkgxmldir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgxmlDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkgxmlDATA + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-pkgxmlDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-info-am uninstall-pkgxmlDATA + + +# +# Some of these need building +# +do-build-file: + rm -f ${FILE}.tmp + sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \ + -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' + cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE} + rm -f ${FILE}.tmp + +catalog.xml: ${srcdir}/catalog.xml.in Makefile ${top_builddir}/config.status + $(MAKE) do-build-file FILE=$@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/schemas/WS-Trust.xsd b/schemas/WS-Trust.xsd new file mode 100644 index 0000000..8c10883 --- /dev/null +++ b/schemas/WS-Trust.xsd @@ -0,0 +1,113 @@ + + + + + + + + + + + + + Actual content model is non-deterministic, hence wildcard. The following shows intended content model: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schemas/catalog.xml.in b/schemas/catalog.xml.in new file mode 100644 index 0000000..e59eb48 --- /dev/null +++ b/schemas/catalog.xml.in @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/schemas/shibboleth-2.0-afp-mf-basic.xsd b/schemas/shibboleth-2.0-afp-mf-basic.xsd new file mode 100644 index 0000000..8d4389f --- /dev/null +++ b/schemas/shibboleth-2.0-afp-mf-basic.xsd @@ -0,0 +1,371 @@ + + + + + + + + + + A match function that evaluates to true. + + + + + + + + + + + A match function that performs a logical AND on the results of all contained matching functions. + + + + + + + + + The set of match function rules to be ANDed. + + + + + + + The set of match function rules to be ANDed. + + + + + + + + + + + + A match function that performs a logical OR on the results of all contained matching functions. + + + + + + + + + The set of match function rules to be ANDed. + + + + + + + The set of match function rules to be ANDed. + + + + + + + + + + + + A match function that performs a logical NOT on the resultof the contained matching function. + + + + + + + + + The set of match function rules to be ANDed. + + + + + + + The set of match function rules to be ANDed. + + + + + + + + + + + + + A match function that matches the attribute request against the specified value. + + + + + + + + + + + A match function that matches the attribute issuer against the specified value. + + + + + + + + + + A match function that matches the principal name against the specified value. + + + + + + + + + + A match function that matches the authentication method against the specified value. + + + + + + + + + + + A match function that matches the value of an attribute against the specified value. This match + evaluates to true if the attribute contains the specified value. + + + + + + + + + + + A match function that matches the attribute scope against the specified value. + + + + + + + + + + + + + + The ID of the attribute whose value should be matched. If no attribute ID is specified the + ID of the containing attribute rule is assumed. + + + + + + + + + + + + + The string value to match. + + + + + + A boolean flag indicating whether case should be ignored when evaluating the match. + + + + + + + + + + + + A match function that matches the attribute requester against the specified regular expression. + + + + + + + + + + + A match function that matches the attribute issuer against the specified regular expression. + + + + + + + + + + + A match function that matches the principal name against the specified regular expression. + + + + + + + + + + + A match function that matches the authentication method against the specified regular expression. + + + + + + + + + + + A match function that matches an attribute value against the specified regular expression. This function + evaluates to true if any value matches the given expression + + + + + + + + + + + A match function that matches the attribute scope against the specified regular expression. + + + + + + + + + + + + + + The ID of the attribute whose value should be matched. If no attribute ID is specified the + ID of the containing attribute rule is assumed. + + + + + + + + + + + + + The regular expression values are matched against. + + + + + The regular expression options to apply. + + + + + + + + + + + A match function that evaluates a script to determine if some criteria is met. The script MUST return a + boolean. + + + + + + + + The script to evaluate to construct the attribute. + + + + + + The filesystem path to the script to evaluate to construct the attribute. + + + + + + + + The JSR-233 name for the scripting language that will be used. By default "javascript" is + supported. + + + + + + + + + + + A match function that evaluates to true if the given attribute has as a number of values that falls + between the minimum and maximum. This method may be used as a sanity check to ensure that an unexpected + number of values did not come from the attribute resolver and be released. + + + + + + + The ID of the attribute whose value should be matched. + + + + + Minimum number of values an attribute may have. + + + + + Maximum number of values an attribute may have. + + + + + + + \ No newline at end of file diff --git a/schemas/shibboleth-2.0-afp-mf-saml.xsd b/schemas/shibboleth-2.0-afp-mf-saml.xsd new file mode 100644 index 0000000..3203e25 --- /dev/null +++ b/schemas/shibboleth-2.0-afp-mf-saml.xsd @@ -0,0 +1,60 @@ + + + + + + + + + A set of SAML specific match functions. These match functions only operate against a SAMLFilterContext. + + + + + + + A match function that evaluates to true if the attribute requester is found in metadata and is a member + of the given entity group. + + + + + + + + + + + A match function that evaluates to true if the attribute producer is found in metadata and is a member + of the given entity group. + + + + + + + + + + + + + The entity group ID that an entity must be in. + + + + + + + + + + A match function that ensures that an attributes value's scope matches a scope given in metadata for the entity or role. + + + + + + + \ No newline at end of file diff --git a/schemas/shibboleth-2.0-afp.xsd b/schemas/shibboleth-2.0-afp.xsd new file mode 100644 index 0000000..e132a4f --- /dev/null +++ b/schemas/shibboleth-2.0-afp.xsd @@ -0,0 +1,187 @@ + + + + + + + + Schema for the attribute filter policies. + + + + + + Root element of the attribute filter policy. Represents a named group of filter policies. + + + + + + + + + + + Defines a set of applications requirements that may be reused across multiple filter + policies. + + + + + + + Defines an attribute value filter that may be reused across multiple attribute rules. + + + + + + + Defines an attribute rule that may be reused across multiple filter policies. + + + + + + + A policy that defines the set of attribute value filters that will be applied if its + application requirements are met. + + + + + + + Digital signature for the policy. Policies that are fetched from an external source, + such as a federation site, should be signed. + + + + + + + + + + + + A policy that defines a set of attribute value filters rules that should be used if given requirements + are met. + + + + + + + + + + + + A requirement that if met signals that this filter policy should be used. + + + + + + + Rerfence to a PolicyRequirement defined within this policy group or another. + + + + + + + + + A rule that describes how values of an attribute will be filtered. + + + + + + + Rerfence to a AttribtueRule defined within this policy group or another. + + + + + + + + + + + + A rule that describes how values of an attribute will be filtered. + + + + + + + + + + A filter for attribute values. If the filter evaluates to true the value is permitted, + otherwise it is filtered out. + + + + + + + Rerfence to a PermitValueRule defined within this policy group or another. + + + + + + + The ID of the attribute to which this rule applies. + + + + + + + + + A requirement that if met signals that a filter policy should be used. + + + + + + A filter for attribtue values. If the filter evaluates to true the value is permitted, otherwise it is + filtered out. + + + + + + + + + + + + + An ID, unique within the policy and component type. + + + + + + + + Used to reference a globally defined policy component. + + + + + \ No newline at end of file diff --git a/schemas/shibboleth-2.0-attribute-map.xsd b/schemas/shibboleth-2.0-attribute-map.xsd new file mode 100644 index 0000000..7f88ac1 --- /dev/null +++ b/schemas/shibboleth-2.0-attribute-map.xsd @@ -0,0 +1,127 @@ + + + + + + This schema maps SAML attributes into Shibboleth internal attributes. + + + + + + + + + + + + + + + + The set of SAML 1/2 attribute mappings. + + + + + + + + + + + Rule for mapping a SAML 1/2 attribute to an internal attribute. + + + + + + + The internal attribute ID to which this SAML attribute maps. + + + + + Optional aliases for the internal attribute to which this SAML attribute maps. + + + + + The SAML 1 AttributeName or SAML 2 Name of the attribute. + + + + + The SAML 1 Namespace or SAML 2 NameFormat of the attribute. + + + + + + + + Decodes a SAML attribute into its Shibboleth-internal representation. + + + + + + Flag controlling case sensitivity when comparisons to the attribute's values are done. + + + + + + + + + Decoder for attributes with string values. + + + + + + + + + + + Decoder for attributes with scoped values. + + + + + + + + The character(s) used to delimit the scoped information from the scope. + + + + + + + + + + + Decoder for attributes with NameID values. + + + + + + + + The pattern used to generate string versions of the attribute's values. + + + + + + + + \ No newline at end of file diff --git a/schemas/shibboleth-2.0-native-sp-config.xsd b/schemas/shibboleth-2.0-native-sp-config.xsd new file mode 100644 index 0000000..ec8bf41 --- /dev/null +++ b/schemas/shibboleth-2.0-native-sp-config.xsd @@ -0,0 +1,706 @@ + + + + + + + + + + 2.0 schema for XML-based configuration of Shibboleth Native SP instances. + First appearing in Shibboleth 2.0 release. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Root of configuration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Container for extension libraries and custom configuration + + + + + + + + + + + + + + + + + + + + + References StorageService plugins + + + + + + + + + + + + + + + + + + References SessionCache plugins + + + + + + + + + + + + + + + + + + Ties ReplayCache to a custom StorageService + + + + + + + + + + Customizes an ArtifactMap + + + + + + + + + + + + Container for out-of-process (shibd) configuration + + + + + + + + + + + + + + + + Container for configuration of locally integrated or platform-specific + features (e.g. web server filters) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A simple example access policy language extension that supersedes Apache .htaccess + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Built-in request mapping syntax, decomposes URLs into Host/Path/Path/... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Container for default settings and application-specific overrides + + + + + + + + + + + + + + + + + + + + + + + + + + + + Container for application-specific overrides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Container for specifying protocol handlers and session policy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used to reference Policy elements from profile endpoints. + + + + + + Used to specify handlers that can issue AuthnRequests or perform discovery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used to specify handlers that can issue LogoutRequests + + + + + + + + + + + + + + + + + + + + + Container for error templates and associated details + + + + + + + + + + + + + + + + + + + + + + Container for specifying settings to use with particular peers + + + + + + + + + + + + + Used to specify locations to receive application notifications + + + + + + + + + + + + + + + + + + + Container for specifying sets of policy rules to apply to incoming messages + + + + + + Specifies a set of SecurityPolicyRule plugins + + + + + + + + + + + + + + + + + Implementation-specific option to pass to SOAPTransport provider. + + + + + + + + + + + + diff --git a/schemas/shibboleth-2.0-sp-notify.xsd b/schemas/shibboleth-2.0-sp-notify.xsd new file mode 100644 index 0000000..6a46bfb --- /dev/null +++ b/schemas/shibboleth-2.0-sp-notify.xsd @@ -0,0 +1,64 @@ + + + + + + Defines local application notification protocol used by SP. + + + + + + + + + + + + + + + + + + + + + + Notifies application of a logout event. + + + + + + + + + + + + + + + + + + Notifies application of a NameID management event. + + + + + + + + + + + diff --git a/schemas/shibboleth-metadata-1.0.xsd b/schemas/shibboleth-metadata-1.0.xsd new file mode 100644 index 0000000..be1441d --- /dev/null +++ b/schemas/shibboleth-metadata-1.0.xsd @@ -0,0 +1,42 @@ + + + + + + + + + SAML metadata extension used to regulate allowable attribute scopes. + + + + + + + + + + + + + + + Binds keying authorities to the system entity/entities to which the enclosing + metadata element applies. + + + + + + + + + + + + diff --git a/schemas/shibboleth.xsd b/schemas/shibboleth.xsd new file mode 100644 index 0000000..307e3b6 --- /dev/null +++ b/schemas/shibboleth.xsd @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + By convention, all Shibboleth 1.1 origin attribute values carry this unconstrained xsi:type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + All sites have a Name attribute, plus optional i18n-ized aliases. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A human contact for a site. + + + + + + + + + A string element with an optional attribute signaling regexp content. + + + + + + + + + + + Metadata about a SAML authority. + + + + + + + + + + + Origin sites add at least one handle service (with a name), plus optional domains trusted for attribute scoping. + + + + + + + + + + + + + + + + A metadata extension used to regulate allowable attribute scopes. + + + + + + + Destination sites add at least one attribute requester (with a name). + + + + + + + + + + + + + + + + + + + + + + + + + + Used to logically group sites together, optionally signed. + + + + + + + + + + + + + + + + + + + + + + + + + + + Binds a set of keying material to one or more named system entities. + + + + + + + + + + + + + An optionally signed collection of KeyAuthority data. + + + + + + + + + + + + + + diff --git a/selinux/Makefile.am b/selinux/Makefile.am new file mode 100644 index 0000000..40c68f5 --- /dev/null +++ b/selinux/Makefile.am @@ -0,0 +1,25 @@ +## $Id: Makefile.am 2308 2007-06-12 04:56:15Z cantor $ + +AUTOMAKE_OPTIONS = foreign + +varrundir = $(localstatedir)/run +BUILDFILES = shibshar.fc +CLEANFILES = $(BUILDFILES) + +sepolicy = targeted +selinuxdir = $(sysconfdir)/selinux/targeted/src/policy +fcfiledir = $(selinuxdir)/file_contexts/program +fcfile_DATA = shibshar.fc + +tefiledir = $(selinuxdir)/domains/program +tefile_DATA = shibshar.te + +shibshar.fc: ${srcdir}/shibshar.fc.in Makefile ${top_builddir}/config.status + rm -f $@.tmp + sed < ${srcdir}/$@.in > $@.tmp \ + -e 's:@-SBINDIR-@:${sbindir}:' \ + -e 's:@-VARRUNDIR-@:${varrundir}:' + cmp -s $@ $@.tmp || mv $@.tmp $@ + rm -f $@.tmp + +EXTRA_DIST = shibshar.fc.in shibshar.te diff --git a/selinux/Makefile.in b/selinux/Makefile.in new file mode 100644 index 0000000..8fa8be7 --- /dev/null +++ b/selinux/Makefile.in @@ -0,0 +1,476 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = selinux +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(fcfiledir)" "$(DESTDIR)$(tefiledir)" +fcfileDATA_INSTALL = $(INSTALL_DATA) +tefileDATA_INSTALL = $(INSTALL_DATA) +DATA = $(fcfile_DATA) $(tefile_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +varrundir = $(localstatedir)/run +BUILDFILES = shibshar.fc +CLEANFILES = $(BUILDFILES) +sepolicy = targeted +selinuxdir = $(sysconfdir)/selinux/targeted/src/policy +fcfiledir = $(selinuxdir)/file_contexts/program +fcfile_DATA = shibshar.fc +tefiledir = $(selinuxdir)/domains/program +tefile_DATA = shibshar.te +EXTRA_DIST = shibshar.fc.in shibshar.te +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign selinux/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign selinux/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-fcfileDATA: $(fcfile_DATA) + @$(NORMAL_INSTALL) + test -z "$(fcfiledir)" || $(mkdir_p) "$(DESTDIR)$(fcfiledir)" + @list='$(fcfile_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(fcfileDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(fcfiledir)/$$f'"; \ + $(fcfileDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(fcfiledir)/$$f"; \ + done + +uninstall-fcfileDATA: + @$(NORMAL_UNINSTALL) + @list='$(fcfile_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(fcfiledir)/$$f'"; \ + rm -f "$(DESTDIR)$(fcfiledir)/$$f"; \ + done +install-tefileDATA: $(tefile_DATA) + @$(NORMAL_INSTALL) + test -z "$(tefiledir)" || $(mkdir_p) "$(DESTDIR)$(tefiledir)" + @list='$(tefile_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(tefileDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(tefiledir)/$$f'"; \ + $(tefileDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(tefiledir)/$$f"; \ + done + +uninstall-tefileDATA: + @$(NORMAL_UNINSTALL) + @list='$(tefile_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(tefiledir)/$$f'"; \ + rm -f "$(DESTDIR)$(tefiledir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(fcfiledir)" "$(DESTDIR)$(tefiledir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-fcfileDATA install-tefileDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-fcfileDATA uninstall-info-am \ + uninstall-tefileDATA + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-fcfileDATA install-info install-info-am install-man \ + install-strip install-tefileDATA installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-fcfileDATA \ + uninstall-info-am uninstall-tefileDATA + + +shibshar.fc: ${srcdir}/shibshar.fc.in Makefile ${top_builddir}/config.status + rm -f $@.tmp + sed < ${srcdir}/$@.in > $@.tmp \ + -e 's:@-SBINDIR-@:${sbindir}:' \ + -e 's:@-VARRUNDIR-@:${varrundir}:' + cmp -s $@ $@.tmp || mv $@.tmp $@ + rm -f $@.tmp +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/selinux/shibshar.fc.in b/selinux/shibshar.fc.in new file mode 100644 index 0000000..34d9bd2 --- /dev/null +++ b/selinux/shibshar.fc.in @@ -0,0 +1,4 @@ +# Shibboleth SHAR +@-SBINDIR-@/shibd -- system_u:object_r:shibshar_exec_t +@-VARRUNDIR-@/shib-shar\.sock -s system_u:object_r:shibshar_var_run_t + diff --git a/selinux/shibshar.te b/selinux/shibshar.te new file mode 100644 index 0000000..321da2e --- /dev/null +++ b/selinux/shibshar.te @@ -0,0 +1,33 @@ +# Shibboleth SHAR + +# Define the shibshar daemon. +daemon_domain(shibshar) + +# Transition the shar socket to the shibshar_var_run_t type +# when the shar creates it +file_type_auto_trans(shibshar_t, var_run_t, shibshar_var_run_t, sock_file) + +# Enable the shar to work +can_exec(shibshar_t, shibshar_exec_t) +uses_shlib(shibshar_t) +can_network(shibshar_t) +can_tcp_connect(shibshar_t, unconfined_t) +allow shibshar_t port_type:tcp_socket name_connect; +allow shibshar_t etc_t:file r_file_perms; +allow shibshar_t bin_t:dir r_dir_perms; +allow shibshar_t bin_t:file rx_file_perms; +allow shibshar_t var_log_t:dir rw_dir_perms; +allow shibshar_t var_log_t:file rw_file_perms; +allow shibshar_t var_log_t:file { create }; + +allow shibshar_t shibshar_t:unix_stream_socket create_stream_socket_perms; +allow shibshar_t shibshar_t:netlink_route_socket { create bind getattr}; +allow shibshar_t usr_t:dir r_dir_perms; +allow shibshar_t usr_t:file rx_file_perms; + +allow shibshar_t urandom_device_t:chr_file { getattr ioctl read }; + +# Enable HTTPD to connect to the shib-shar socket and read/write to it +can_unix_connect(httpd_t, shibshar_var_run_t) +allow httpd_t shibshar_var_run_t:sock_file { write }; +allow httpd_t shibshar_t:unix_stream_socket { connectto }; diff --git a/shibboleth.spec b/shibboleth.spec new file mode 100644 index 0000000..3fc0ba6 --- /dev/null +++ b/shibboleth.spec @@ -0,0 +1,258 @@ +Name: shibboleth +Summary: Open source system for attribute-based Web SSO +Version: 2.0 +Release: 6 +#Copyright: Internet2 +Group: System Environment/Libraries +License: Apache style +URL: http://shibboleth.internet2.edu/ +Source0: http://shibboleth.internet2.edu/downloads/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-root +BuildRequires: openssl-devel +BuildRequires: xerces%{?xercesver}-c-devel >= 2.8.0 +BuildRequires: xml-security-c-devel >= 1.4.0 +BuildRequires: zlib-devel, opensaml-devel >= 2.0 +%{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0} +%{!?_with_log4cpp:BuildRequires: log4shib-devel} +%{?_with_fastcgi:BuildRequires: fcgi-devel} +%if "%{_vendor}" == "redhat" +%{!?_without_builtinapache:BuildRequires: httpd-devel} +%endif +%if "%{_vendor}" == "suse" +%{!?_without_builtinapache:BuildRequires: apache2-devel} +%endif + + +%description +Shibboleth, a project of Internet2/MACE, is developing architectures, +policy structures, practical technologies, and an open source +implementation to support inter-institutional sharing of web resources +subject to access controls. In addition, Shibboleth will develop a +policy framework that will allow inter-operation within the higher +education community. + +This package contains the shibboleth runtime library and apache module. + +%package devel +Summary: Shibboleth development Headers +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +Shibboleth, a project of Internet2/MACE, is developing architectures, +policy structures, practical technologies, and an open source +implementation to support inter-institutional sharing of web resources +subject to access controls. In addition, Shibboleth will develop a +policy framework that will allow inter-operation within the higher +education community. + +This package contains the headers and other necessary files to build +applications that use the shibboleth library. + +%package docs +Summary: Shibboleth API Documentation +Group: Development/Libraries +Requires: %{name} = %{version} + +%description docs +Shibboleth Library API documentation generated by doxygen. + +%prep +%setup -q + +%build +%configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?_with_fastcgi} %{?shib_options} +%{__make} + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT +%{__make} install NOKEYGEN=1 DESTDIR=$RPM_BUILD_ROOT + +%if "%{_vendor}" == "suse" + %{__sed} -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \ + $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger +%endif + +%check || : +%{__make} check + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT + +%post +%ifnos solaris2.8 solaris2.9 solaris2.10 +/sbin/ldconfig +%endif + + +# Plug the SP into Apache on a recognized system. +APACHE_CONFIG="no" +if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_13.so ] ; then + APACHE_CONFIG="apache.config" +fi +if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_20.so ] ; then + APACHE_CONFIG="apache2.config" +fi +if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_22.so ] ; then + APACHE_CONFIG="apache22.config" +fi +if [ "$APACHE_CONFIG" != "no" ] ; then + APACHE_CONFD="no" + if [ -d %{_sysconfdir}/httpd/conf.d ] ; then + APACHE_CONFD="%{_sysconfdir}/httpd/conf.d" + fi + if [ -d %{_sysconfdir}/apache2/conf.d ] ; then + APACHE_CONFD="%{_sysconfdir}/apache2/conf.d" + fi + if [ "$APACHE_CONFD" != "no" ] ; then + if [ ! -f $APACHE_CONFD/shib.conf ] ; then +%if "%{_vendor}" == "suse" + %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \ + %{_sysconfdir}/%{name}/$APACHE_CONFIG \ + > $APACHE_CONFD/shib.conf +%else + %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-2.0/g" \ + %{_sysconfdir}/%{name}/$APACHE_CONFIG \ + > $APACHE_CONFD/shib.conf +%endif + fi + fi +fi + +# Install the shibd init.d scripts and service +%if "%{_vendor}" == "redhat" + if [ -d %{_sysconfdir}/init.d ] ; then + if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then + %{__cp} -p %{_sysconfdir}/%{name}/shibd-%{_vendor} %{_sysconfdir}/init.d/shibd + %{__chmod} 755 %{_sysconfdir}/init.d/shibd + chkconfig --add shibd + fi + fi +%endif + +# Key generation +cd %{_sysconfdir}/%{name} +sh ./keygen.sh -b + +%postun +%ifnos solaris2.8 solaris2.9 solaris2.10 +/sbin/ldconfig +%endif + +# delete the Apache configuration if we're being removed +[ "$1" = 0 ] || exit 0 +[ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \ + %{__rm} -f %{_sysconfdir}/httpd/conf.d/shib.conf +[ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \ + %{__rm} -f %{_sysconfdir}/apache2/conf.d/shib.conf + +# clear init.d state +%if "%{_vendor}" == "redhat" + chkconfig --del shibd + [ -f %{_sysconfdir}/init.d/shibd ] && \ + %{__rm} -f %{_sysconfdir}/init.d/shibd +%endif + +%files +%defattr(-,root,root,-) +%{_sbindir}/shibd +%{_bindir}/mdquery +%{_bindir}/resolvertest +%{_libdir}/libshibsp.so.* +%{_libdir}/libshibsp-lite.so.* +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/* +%exclude %{_libdir}/%{name}/*.la +%dir %{_localstatedir}/log/%{name} +%dir %{_localstatedir}/run/%{name} +%dir %{_datadir}/xml/%{name} +%{_datadir}/xml/%{name}/* +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/*.xml +%config(noreplace) %{_sysconfdir}/%{name}/*.html +%config(noreplace) %{_sysconfdir}/%{name}/*.logger +%{_sysconfdir}/%{name}/*.dist +%{_sysconfdir}/%{name}/apache*.config +%{_sysconfdir}/%{name}/shibd-redhat +%{_sysconfdir}/%{name}/shibd-debian +%{_sysconfdir}/%{name}/shibd-osx.plist +%{_sysconfdir}/%{name}/keygen.sh +%{_sysconfdir}/%{name}/*.xsl +%docdir %{_datadir}/doc/%{name} +%{_datadir}/doc/%{name}/CREDITS.txt +%{_datadir}/doc/%{name}/FASTCGI.LICENSE +%{_datadir}/doc/%{name}/LICENSE.txt +%{_datadir}/doc/%{name}/LOG4CPP.LICENSE +%{_datadir}/doc/%{name}/logo.jpg +%{_datadir}/doc/%{name}/main.css +%{_datadir}/doc/%{name}/NOTICE.txt +%{_datadir}/doc/%{name}/OPENSSL.LICENSE +%{_datadir}/doc/%{name}/README.txt +%{_datadir}/doc/%{name}/RELEASE.txt + +%files devel +%defattr(-,root,root,-) +%{_includedir} +%{_libdir}/libshibsp.so +%{_libdir}/libshibsp-lite.so + +%files docs +%defattr(644,root,root,755) +%doc %{_datadir}/doc/%{name}/api + +%changelog +* Mon Mar 17 2008 Scott Cantor - 2.0-6 +- Official release. + +* Fri Jan 18 2008 Scott Cantor - 2.0-5 +- Release candidate 1. + +* Sun Oct 21 2007 Scott Cantor - 2.0-4 +- libexec -> lib/shibboleth changes +- Added doc subpackage + +* Thu Aug 16 2007 Scott Cantor - 2.0-3 +- First public beta. + +* Fri Jul 13 2007 Scott Cantor - 2.0-2 +- Second alpha release. + +* Sun Jun 10 2007 Scott Cantor - 2.0-1 +- First alpha release. + +* Mon Oct 2 2006 Scott Cantor - 1.3-11 +- Applied fix for secadv 20061002 +- Fix for metadata loader loop + +* Wed Jun 15 2006 Scott Cantor - 1.3-10 +- Applied fix for sec 20060615 + +* Fri Apr 15 2006 Scott Cantor - 1.3-9 +- Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support + +* Mon Jan 9 2006 Scott Cantor - 1.3-8 +- Applied new fix for secadv 20060109 + +* Tue Nov 8 2005 Scott Cantor - 1.3-7 +- Applied new fix for secadv 20050901 plus rollup + +* Fri Sep 23 2005 Scott Cantor - 1.3-6 +- Minor patches and default config changes +- pidfile patch +- Fix shib.conf creation +- Integrated init.d script +- Prevent replacement of config files + +* Thu Sep 1 2005 Scott Cantor - 1.3-5 +- Applied fix for secadv 20050901 plus rollup of NSAPI fixes + +* Sun Apr 24 2005 Scott Cantor - 1.3-1 +- Updated test programs and location of schemas. +- move siterefresh to to sbindir + +* Fri Apr 1 2005 Derek Atkins - 1.3-1 +- Add selinux-targeted-policy package +- move shar to sbindir + +* Tue Oct 19 2004 Derek Atkins - 1.2-1 +- Create SPEC file based on various versions in existence. diff --git a/shibboleth.spec.in b/shibboleth.spec.in new file mode 100644 index 0000000..e716a24 --- /dev/null +++ b/shibboleth.spec.in @@ -0,0 +1,258 @@ +Name: shibboleth +Summary: Open source system for attribute-based Web SSO +Version: @-VERSION-@ +Release: 6 +#Copyright: Internet2 +Group: System Environment/Libraries +License: Apache style +URL: http://shibboleth.internet2.edu/ +Source0: http://shibboleth.internet2.edu/downloads/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-root +BuildRequires: openssl-devel +BuildRequires: xerces%{?xercesver}-c-devel >= 2.8.0 +BuildRequires: xml-security-c-devel >= 1.4.0 +BuildRequires: zlib-devel, opensaml-devel >= 2.0 +%{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0} +%{!?_with_log4cpp:BuildRequires: log4shib-devel} +%{?_with_fastcgi:BuildRequires: fcgi-devel} +%if "%{_vendor}" == "redhat" +%{!?_without_builtinapache:BuildRequires: httpd-devel} +%endif +%if "%{_vendor}" == "suse" +%{!?_without_builtinapache:BuildRequires: apache2-devel} +%endif + + +%description +Shibboleth, a project of Internet2/MACE, is developing architectures, +policy structures, practical technologies, and an open source +implementation to support inter-institutional sharing of web resources +subject to access controls. In addition, Shibboleth will develop a +policy framework that will allow inter-operation within the higher +education community. + +This package contains the shibboleth runtime library and apache module. + +%package devel +Summary: Shibboleth development Headers +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +Shibboleth, a project of Internet2/MACE, is developing architectures, +policy structures, practical technologies, and an open source +implementation to support inter-institutional sharing of web resources +subject to access controls. In addition, Shibboleth will develop a +policy framework that will allow inter-operation within the higher +education community. + +This package contains the headers and other necessary files to build +applications that use the shibboleth library. + +%package docs +Summary: Shibboleth API Documentation +Group: Development/Libraries +Requires: %{name} = %{version} + +%description docs +Shibboleth Library API documentation generated by doxygen. + +%prep +%setup -q + +%build +%configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?_with_fastcgi} %{?shib_options} +%{__make} + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT +%{__make} install NOKEYGEN=1 DESTDIR=$RPM_BUILD_ROOT + +%if "%{_vendor}" == "suse" + %{__sed} -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \ + $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger +%endif + +%check || : +%{__make} check + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT + +%post +%ifnos solaris2.8 solaris2.9 solaris2.10 +/sbin/ldconfig +%endif + + +# Plug the SP into Apache on a recognized system. +APACHE_CONFIG="no" +if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_13.so ] ; then + APACHE_CONFIG="apache.config" +fi +if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_20.so ] ; then + APACHE_CONFIG="apache2.config" +fi +if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_22.so ] ; then + APACHE_CONFIG="apache22.config" +fi +if [ "$APACHE_CONFIG" != "no" ] ; then + APACHE_CONFD="no" + if [ -d %{_sysconfdir}/httpd/conf.d ] ; then + APACHE_CONFD="%{_sysconfdir}/httpd/conf.d" + fi + if [ -d %{_sysconfdir}/apache2/conf.d ] ; then + APACHE_CONFD="%{_sysconfdir}/apache2/conf.d" + fi + if [ "$APACHE_CONFD" != "no" ] ; then + if [ ! -f $APACHE_CONFD/shib.conf ] ; then +%if "%{_vendor}" == "suse" + %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \ + %{_sysconfdir}/%{name}/$APACHE_CONFIG \ + > $APACHE_CONFD/shib.conf +%else + %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \ + %{_sysconfdir}/%{name}/$APACHE_CONFIG \ + > $APACHE_CONFD/shib.conf +%endif + fi + fi +fi + +# Install the shibd init.d scripts and service +%if "%{_vendor}" == "redhat" + if [ -d %{_sysconfdir}/init.d ] ; then + if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then + %{__cp} -p %{_sysconfdir}/%{name}/shibd-%{_vendor} %{_sysconfdir}/init.d/shibd + %{__chmod} 755 %{_sysconfdir}/init.d/shibd + chkconfig --add shibd + fi + fi +%endif + +# Key generation +cd %{_sysconfdir}/%{name} +sh ./keygen.sh -b + +%postun +%ifnos solaris2.8 solaris2.9 solaris2.10 +/sbin/ldconfig +%endif + +# delete the Apache configuration if we're being removed +[ "$1" = 0 ] || exit 0 +[ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \ + %{__rm} -f %{_sysconfdir}/httpd/conf.d/shib.conf +[ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \ + %{__rm} -f %{_sysconfdir}/apache2/conf.d/shib.conf + +# clear init.d state +%if "%{_vendor}" == "redhat" + chkconfig --del shibd + [ -f %{_sysconfdir}/init.d/shibd ] && \ + %{__rm} -f %{_sysconfdir}/init.d/shibd +%endif + +%files +%defattr(-,root,root,-) +%{_sbindir}/shibd +%{_bindir}/mdquery +%{_bindir}/resolvertest +%{_libdir}/libshibsp.so.* +%{_libdir}/libshibsp-lite.so.* +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/* +%exclude %{_libdir}/%{name}/*.la +%dir %{_localstatedir}/log/%{name} +%dir %{_localstatedir}/run/%{name} +%dir %{_datadir}/xml/%{name} +%{_datadir}/xml/%{name}/* +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/*.xml +%config(noreplace) %{_sysconfdir}/%{name}/*.html +%config(noreplace) %{_sysconfdir}/%{name}/*.logger +%{_sysconfdir}/%{name}/*.dist +%{_sysconfdir}/%{name}/apache*.config +%{_sysconfdir}/%{name}/shibd-redhat +%{_sysconfdir}/%{name}/shibd-debian +%{_sysconfdir}/%{name}/shibd-osx.plist +%{_sysconfdir}/%{name}/keygen.sh +%{_sysconfdir}/%{name}/*.xsl +%docdir %{_datadir}/doc/%{name} +%{_datadir}/doc/%{name}/CREDITS.txt +%{_datadir}/doc/%{name}/FASTCGI.LICENSE +%{_datadir}/doc/%{name}/LICENSE.txt +%{_datadir}/doc/%{name}/LOG4CPP.LICENSE +%{_datadir}/doc/%{name}/logo.jpg +%{_datadir}/doc/%{name}/main.css +%{_datadir}/doc/%{name}/NOTICE.txt +%{_datadir}/doc/%{name}/OPENSSL.LICENSE +%{_datadir}/doc/%{name}/README.txt +%{_datadir}/doc/%{name}/RELEASE.txt + +%files devel +%defattr(-,root,root,-) +%{_includedir} +%{_libdir}/libshibsp.so +%{_libdir}/libshibsp-lite.so + +%files docs +%defattr(644,root,root,755) +%doc %{_datadir}/doc/%{name}/api + +%changelog +* Mon Mar 17 2008 Scott Cantor - 2.0-6 +- Official release. + +* Fri Jan 18 2008 Scott Cantor - 2.0-5 +- Release candidate 1. + +* Sun Oct 21 2007 Scott Cantor - 2.0-4 +- libexec -> lib/shibboleth changes +- Added doc subpackage + +* Thu Aug 16 2007 Scott Cantor - 2.0-3 +- First public beta. + +* Fri Jul 13 2007 Scott Cantor - 2.0-2 +- Second alpha release. + +* Sun Jun 10 2007 Scott Cantor - 2.0-1 +- First alpha release. + +* Mon Oct 2 2006 Scott Cantor - 1.3-11 +- Applied fix for secadv 20061002 +- Fix for metadata loader loop + +* Wed Jun 15 2006 Scott Cantor - 1.3-10 +- Applied fix for sec 20060615 + +* Fri Apr 15 2006 Scott Cantor - 1.3-9 +- Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support + +* Mon Jan 9 2006 Scott Cantor - 1.3-8 +- Applied new fix for secadv 20060109 + +* Tue Nov 8 2005 Scott Cantor - 1.3-7 +- Applied new fix for secadv 20050901 plus rollup + +* Fri Sep 23 2005 Scott Cantor - 1.3-6 +- Minor patches and default config changes +- pidfile patch +- Fix shib.conf creation +- Integrated init.d script +- Prevent replacement of config files + +* Thu Sep 1 2005 Scott Cantor - 1.3-5 +- Applied fix for secadv 20050901 plus rollup of NSAPI fixes + +* Sun Apr 24 2005 Scott Cantor - 1.3-1 +- Updated test programs and location of schemas. +- move siterefresh to to sbindir + +* Fri Apr 1 2005 Derek Atkins - 1.3-1 +- Add selinux-targeted-policy package +- move shar to sbindir + +* Tue Oct 19 2004 Derek Atkins - 1.2-1 +- Create SPEC file based on various versions in existence. diff --git a/shibd/Makefile.am b/shibd/Makefile.am new file mode 100644 index 0000000..b545cdc --- /dev/null +++ b/shibd/Makefile.am @@ -0,0 +1,14 @@ +## $Id: Makefile.am 2283 2007-06-01 17:35:42Z cantor $ + +AUTOMAKE_OPTIONS = foreign + +sbin_PROGRAMS = shibd + +shibd_SOURCES = shibd.cpp + +shibd_LDADD = \ + $(top_builddir)/shibsp/libshibsp.la + +shibd_LDFLAGS = $(XMLSEC_LIBS) + +EXTRA_DIST = shibd.vcproj shibd_win32.cpp resource.h shibd.rc diff --git a/shibd/Makefile.in b/shibd/Makefile.in new file mode 100644 index 0000000..2f5a1f4 --- /dev/null +++ b/shibd/Makefile.in @@ -0,0 +1,548 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +sbin_PROGRAMS = shibd$(EXEEXT) +subdir = shibd +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(sbindir)" +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(sbin_PROGRAMS) +am_shibd_OBJECTS = shibd.$(OBJEXT) +shibd_OBJECTS = $(am_shibd_OBJECTS) +shibd_DEPENDENCIES = $(top_builddir)/shibsp/libshibsp.la +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(shibd_SOURCES) +DIST_SOURCES = $(shibd_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +shibd_SOURCES = shibd.cpp +shibd_LDADD = \ + $(top_builddir)/shibsp/libshibsp.la + +shibd_LDFLAGS = $(XMLSEC_LIBS) +EXTRA_DIST = shibd.vcproj shibd_win32.cpp resource.h shibd.rc +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign shibd/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign shibd/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ + done + +clean-sbinPROGRAMS: + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +shibd$(EXEEXT): $(shibd_OBJECTS) $(shibd_DEPENDENCIES) + @rm -f shibd$(EXEEXT) + $(CXXLINK) $(shibd_LDFLAGS) $(shibd_OBJECTS) $(shibd_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shibd.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(sbindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-sbinPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-sbinPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-sbinPROGRAMS install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-sbinPROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/shibd/resource.h b/shibd/resource.h new file mode 100644 index 0000000..fd2d1fe --- /dev/null +++ b/shibd/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by shibd.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/shibd/shibd.cpp b/shibd/shibd.cpp new file mode 100644 index 0000000..c1eaf5f --- /dev/null +++ b/shibd/shibd.cpp @@ -0,0 +1,344 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * shar.cpp -- the shibd "main" code. All the functionality is elsewhere + * + * Created By: Derek Atkins + * + * $Id: shar.cpp 2164 2007-02-11 05:26:18 +0000 (Sun, 11 Feb 2007) cantor $ + */ + + +// eventually we might be able to support autoconf via cygwin... +#if defined (_MSC_VER) || defined(__BORLANDC__) +# include "config_win32.h" +#else +# include "config.h" +#endif + +#ifdef WIN32 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include + +#ifdef HAVE_UNISTD_H +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +bool shibd_shutdown = false; +const char* shar_config = NULL; +const char* shar_schemadir = NULL; +const char* shar_prefix = NULL; +bool shar_checkonly = false; +bool shar_version = false; +static int unlink_socket = 0; +const char* pidfile = NULL; + +#ifdef WIN32 + +//#include + +#define nNoMansLandSize 4 +typedef struct _CrtMemBlockHeader +{ + struct _CrtMemBlockHeader * pBlockHeaderNext; + struct _CrtMemBlockHeader * pBlockHeaderPrev; + char * szFileName; + int nLine; + size_t nDataSize; + int nBlockUse; + long lRequest; + unsigned char gap[nNoMansLandSize]; + /* followed by: + * unsigned char data[nDataSize]; + * unsigned char anotherGap[nNoMansLandSize]; + */ +} _CrtMemBlockHeader; + +/* +int MyAllocHook(int nAllocType, void *pvData, + size_t nSize, int nBlockUse, long lRequest, + const unsigned char * szFileName, int nLine) +{ + if ( nBlockUse == _CRT_BLOCK ) + return( TRUE ); + if (nAllocType == _HOOK_FREE) { + _CrtMemBlockHeader* ptr = (_CrtMemBlockHeader*)(((_CrtMemBlockHeader *)pvData)-1); + if (ptr->nDataSize == 8192) + fprintf(stderr,"free request %u size %u\n", ptr->lRequest, ptr->nDataSize); + } + else if (nAllocType == _HOOK_ALLOC && nSize == 8192) + fprintf(stderr,"%s request %u size %u\n", ((nAllocType == _HOOK_ALLOC) ? "alloc" : "realloc"), lRequest, nSize); + return (TRUE); +} +*/ + +int real_main(int preinit) +{ + SPConfig& conf=SPConfig::getConfig(); + if (preinit) { + + // Initialize the SP library. + conf.setFeatures( + SPConfig::Listener | + SPConfig::Caching | + SPConfig::Metadata | + SPConfig::Trust | + SPConfig::Credentials | + SPConfig::AttributeResolution | + SPConfig::Handlers | + SPConfig::OutOfProcess | + (shar_checkonly ? SPConfig::RequestMapping : SPConfig::Logging) + ); + if (!conf.init(shar_schemadir, shar_prefix)) { + fprintf(stderr, "configuration is invalid, see console for specific problems\n"); + return -1; + } + + if (!shar_config) + shar_config=getenv("SHIBSP_CONFIG"); + if (!shar_config) + shar_config=SHIBSP_CONFIG; + + try { + static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); + static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); + xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(shar_config); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + conf.setServiceProvider(conf.ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + conf.getServiceProvider()->init(); + } + catch (exception& ex) { + fprintf(stderr, "caught exception while loading configuration: %s\n", ex.what()); + conf.term(); + return -2; + } + + // If just a test run, bail. + if (shar_checkonly) { + fprintf(stdout, "overall configuration is loadable, check console for non-fatal problems\n"); + return 0; + } + } + else { + + //_CrtSetAllocHook(MyAllocHook); + + // Run the listener + if (!shar_checkonly) { + + // Run the listener. + if (!conf.getServiceProvider()->getListenerService()->run(&shibd_shutdown)) { + fprintf(stderr, "listener failed to enter listen loop\n"); + return -3; + } + } + + conf.term(); + } + return 0; +} + +#else + +static void term_handler(int arg) +{ + shibd_shutdown = true; +} + +static int setup_signals(void) +{ + struct sigaction sa; + memset(&sa, 0, sizeof (sa)); + sa.sa_handler = SIG_IGN; + sa.sa_flags = SA_RESTART; + + if (sigaction(SIGPIPE, &sa, NULL) < 0) { + return -1; + } + + memset(&sa, 0, sizeof (sa)); + sa.sa_handler = term_handler; + sa.sa_flags = SA_RESTART; + + if (sigaction(SIGHUP, &sa, NULL) < 0) { + return -1; + } + if (sigaction(SIGINT, &sa, NULL) < 0) { + return -1; + } + if (sigaction(SIGQUIT, &sa, NULL) < 0) { + return -1; + } + if (sigaction(SIGTERM, &sa, NULL) < 0) { + return -1; + } + return 0; +} + +static void usage(char* whoami) +{ + fprintf(stderr, "usage: %s [-dcxtfpvh]\n", whoami); + fprintf(stderr, " -d\tinstallation prefix to use.\n"); + fprintf(stderr, " -c\tconfig file to use.\n"); + fprintf(stderr, " -x\tXML schema catalogs to use.\n"); + fprintf(stderr, " -t\tcheck configuration file for problems.\n"); + fprintf(stderr, " -f\tforce removal of listener socket.\n"); + fprintf(stderr, " -p\tpid file to use.\n"); + fprintf(stderr, " -v\tprint software version.\n"); + fprintf(stderr, " -h\tprint this help message.\n"); + exit(1); +} + +static int parse_args(int argc, char* argv[]) +{ + int opt; + + while ((opt = getopt(argc, argv, "d:c:x:p:ftvh")) > 0) { + switch (opt) { + case 'd': + shar_prefix=optarg; + break; + case 'c': + shar_config=optarg; + break; + case 'x': + shar_schemadir=optarg; + break; + case 'f': + unlink_socket = 1; + break; + case 't': + shar_checkonly=true; + break; + case 'v': + shar_version=true; + break; + case 'p': + pidfile=optarg; + break; + default: + return -1; + } + } + return 0; +} + +int main(int argc, char *argv[]) +{ + if (parse_args(argc, argv) != 0) + usage(argv[0]); + else if (shar_version) { + fprintf(stdout, PACKAGE_STRING"\n"); + return 0; + } + + if (setup_signals() != 0) + return -1; + + // initialize the shib-target library + SPConfig& conf=SPConfig::getConfig(); + conf.setFeatures( + SPConfig::Listener | + SPConfig::Caching | + SPConfig::Metadata | + SPConfig::Trust | + SPConfig::Credentials | + SPConfig::AttributeResolution | + SPConfig::Handlers | + SPConfig::OutOfProcess | + (shar_checkonly ? SPConfig::RequestMapping : SPConfig::Logging) + ); + if (!conf.init(shar_schemadir, shar_prefix)) { + fprintf(stderr, "configuration is invalid, check console for specific problems\n"); + return -1; + } + + if (!shar_config) + shar_config=getenv("SHIBSP_CONFIG"); + if (!shar_config) + shar_config=SHIBSP_CONFIG; + + try { + static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); + static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); + xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(shar_config); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + conf.setServiceProvider(conf.ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + conf.getServiceProvider()->init(); + } + catch (exception& ex) { + fprintf(stderr, "caught exception while loading configuration: %s\n", ex.what()); + conf.term(); + return -2; + } + + if (shar_checkonly) + fprintf(stderr, "overall configuration is loadable, check console for non-fatal problems\n"); + else { + + // Write the pid file + if (pidfile) { + FILE* pidf = fopen(pidfile, "w"); + if (pidf) { + fprintf(pidf, "%d\n", getpid()); + fclose(pidf); + } else { + perror(pidfile); // keep running though + } + } + + // Run the listener + if (!conf.getServiceProvider()->getListenerService()->run(&shibd_shutdown)) { + fprintf(stderr, "listener failed to enter listen loop\n"); + return -3; + } + } + + conf.term(); + if (pidfile) + unlink(pidfile); + return 0; +} + +#endif diff --git a/shibd/shibd.rc b/shibd/shibd.rc new file mode 100644 index 0000000..d02b4b8 --- /dev/null +++ b/shibd/shibd.rc @@ -0,0 +1,109 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" + VALUE "FileDescription", "Shibboleth Daemon Service\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "shibd\0" + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "shibd.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/shibd/shibd.vcproj b/shibd/shibd.vcproj new file mode 100644 index 0000000..ac84e1e --- /dev/null +++ b/shibd/shibd.vcproj @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shibd/shibd_win32.cpp b/shibd/shibd_win32.cpp new file mode 100644 index 0000000..b196ea8 --- /dev/null +++ b/shibd/shibd_win32.cpp @@ -0,0 +1,529 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * shar_win32.cpp -- the SHAR "main" code on Win32 + * + * Created By: Scott Cantor (cantor.2@osu.edu) + * + * $Id: shar_win32.cpp 2150 2007-02-02 04:06:15 +0000 (Fri, 02 Feb 2007) cantor $ + */ + +#include "config_win32.h" + +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#define _CRT_SECURE_NO_DEPRECATE 1 + +#include +#include +#include + +using namespace std; + +extern bool shibd_shutdown; // signals shutdown to Unix side +extern const char* shar_schemadir; +extern const char* shar_config; +extern const char* shar_prefix; +extern bool shar_checkonly; + +// internal variables +SERVICE_STATUS ssStatus; // current status of the service +SERVICE_STATUS_HANDLE sshStatusHandle; +DWORD dwErr = 0; +BOOL bConsole = FALSE; +char szErr[256]; +LPCSTR lpszInstall = NULL; +LPCSTR lpszRemove = NULL; + +// internal function prototypes +VOID WINAPI service_ctrl(DWORD dwCtrlCode); +VOID WINAPI service_main(DWORD dwArgc, LPSTR *lpszArgv); +VOID CmdInstallService(LPCSTR); +VOID CmdRemoveService(LPCSTR); +LPTSTR GetLastErrorText( LPSTR lpszBuf, DWORD dwSize ); + +BOOL LogEvent( + LPCTSTR lpUNCServerName, + WORD wType, + DWORD dwEventID, + PSID lpUserSid, + LPCTSTR message); + +VOID ServiceStart(DWORD dwArgc, LPSTR *lpszArgv); +VOID ServiceStop(); +BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint); +void AddToMessageLog(LPSTR lpszMsg); + +BOOL WINAPI BreakHandler(DWORD dwCtrlType) +{ + switch(dwCtrlType) + { + case CTRL_BREAK_EVENT: // use Ctrl+C or Ctrl+Break to simulate + case CTRL_C_EVENT: // SERVICE_CONTROL_STOP in console mode + ServiceStop(); + return TRUE; + } + return FALSE; +} + + +int real_main(int); // The revised two-phase main() in shar.cpp + +int main(int argc, char *argv[]) +{ + int i=1; + while ((argc > i) && ((*argv[i] == '-') || (*argv[i] == '/'))) + { + if (_stricmp("install", argv[i]+1) == 0) + { + if (argc > ++i) + lpszInstall = argv[i++]; + } + else if (_stricmp("remove", argv[i]+1) == 0) + { + if (argc > ++i) + lpszRemove = argv[i++]; + } + else if (_stricmp( "console", argv[i]+1) == 0) + { + i++; + bConsole = TRUE; + } + else if (_stricmp( "check", argv[i]+1) == 0) + { + i++; + bConsole = TRUE; + shar_checkonly=true; + } + else if (_stricmp( "config", argv[i]+1) == 0) + { + if (argc > ++i) + shar_config = argv[i++]; + } + else if (_stricmp( "prefix", argv[i]+1) == 0) + { + if (argc > ++i) + shar_prefix = argv[i++]; + } + else if (_stricmp( "catalogs", argv[i]+1) == 0) + { + if (argc > ++i) + shar_schemadir = argv[i++]; + } + else + { + goto dispatch; + } + } + + if (bConsole) + { + // Install break handler, then run the C routine twice, once to setup, once to start running. + SetConsoleCtrlHandler(&BreakHandler,TRUE); + if ((i=real_main(1))!=0) + { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "shibd startup failed, check shibd.log for further details"); + return i; + } + return real_main(0); + } + else if (lpszInstall) + { + CmdInstallService(lpszInstall); + return 0; + } + else if (lpszRemove) + { + CmdRemoveService(lpszRemove); + return 0; + } + + + // if it doesn't match any of the above parameters + // the service control manager may be starting the service + // so we must call StartServiceCtrlDispatcher + dispatch: + // this is just to be friendly + printf("%s -install to install the named service\n", argv[0]); + printf("%s -remove to remove the named service\n", argv[0]); + printf("%s -console to run as a console app for debugging\n", argv[0]); + printf("%s -check to run as a console app and check configuration\n", argv[0]); + printf("\t-prefix to specify the installation directory\n"); + printf("\t-config to specify the config file to use\n"); + printf("\t-catalogs to specify schema catalogs\n"); + printf("\nService starting.\nThis may take several seconds. Please wait.\n" ); + + SERVICE_TABLE_ENTRY dispatchTable[] = + { + { "SHIBD", (LPSERVICE_MAIN_FUNCTION)service_main }, + { NULL, NULL } + }; + + if (!StartServiceCtrlDispatcher(dispatchTable)) + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "StartServiceCtrlDispatcher failed."); + return 0; +} + +// +// FUNCTION: ServiceStart +// +// PURPOSE: Actual code of the service +// that does the work. +// +VOID ServiceStart (DWORD dwArgc, LPSTR *lpszArgv) +{ + + if (real_main(1)!=0) + { + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "shibd startup failed, check shibd.log for further details"); + return; + } + + LogEvent(NULL, EVENTLOG_INFORMATION_TYPE, 7700, NULL, "shibd started successfully."); + + if (!ReportStatusToSCMgr(SERVICE_RUNNING, NO_ERROR, 0)) + return; + + real_main(0); +} + + +// +// FUNCTION: ServiceStop +// +// PURPOSE: Stops the service +// +VOID ServiceStop() +{ + if (!bConsole) + LogEvent(NULL, EVENTLOG_INFORMATION_TYPE, 7701, NULL, "shibd stopping..."); + shibd_shutdown=true; +} + + +void WINAPI service_main(DWORD dwArgc, LPSTR *lpszArgv) +{ + + // register our service control handler: + sshStatusHandle=RegisterServiceCtrlHandler(lpszArgv[0], service_ctrl); + if (!sshStatusHandle) + goto cleanup; + + // SERVICE_STATUS members that don't change in example + ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + ssStatus.dwServiceSpecificExitCode = 0; + + + // report the status to the service control manager. + if (!ReportStatusToSCMgr( + SERVICE_START_PENDING, // service state + NO_ERROR, // exit code + 3000)) // wait hint + goto cleanup; + + + ServiceStart(dwArgc, lpszArgv); + +cleanup: + + // try to report the stopped status to the service control manager. + // + if (sshStatusHandle) + (VOID)ReportStatusToSCMgr( + SERVICE_STOPPED, + dwErr, + 0); + + return; +} + + +// +// FUNCTION: service_ctrl +// +// PURPOSE: This function is called by the SCM whenever +// ControlService() is called on this service. +// +// PARAMETERS: +// dwCtrlCode - type of control requested +// +// RETURN VALUE: +// none +// +VOID WINAPI service_ctrl(DWORD dwCtrlCode) +{ + // Handle the requested control code. + // + switch(dwCtrlCode) + { + // Stop the service. + // + case SERVICE_CONTROL_STOP: + ssStatus.dwCurrentState = SERVICE_STOP_PENDING; + ServiceStop(); + break; + + // Update the service status. + // + case SERVICE_CONTROL_INTERROGATE: + break; + + // invalid control code + // + default: + break; + + } + + ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0); +} + + +// +// FUNCTION: ReportStatusToSCMgr() +// +// PURPOSE: Sets the current status of the service and +// reports it to the Service Control Manager +// +// PARAMETERS: +// dwCurrentState - the state of the service +// dwWin32ExitCode - error code to report +// dwWaitHint - worst case estimate to next checkpoint +// +// RETURN VALUE: +// TRUE - success +// FALSE - failure +// +BOOL ReportStatusToSCMgr(DWORD dwCurrentState, + DWORD dwWin32ExitCode, + DWORD dwWaitHint) +{ + static DWORD dwCheckPoint = 1; + BOOL fResult = TRUE; + + + if (!bConsole) // when console we don't report to the SCM + { + if (dwCurrentState == SERVICE_START_PENDING) + ssStatus.dwControlsAccepted = 0; + else + ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; + + ssStatus.dwCurrentState = dwCurrentState; + ssStatus.dwWin32ExitCode = dwWin32ExitCode; + ssStatus.dwWaitHint = dwWaitHint; + + if ( ( dwCurrentState == SERVICE_RUNNING ) || + ( dwCurrentState == SERVICE_STOPPED ) ) + ssStatus.dwCheckPoint = 0; + else + ssStatus.dwCheckPoint = dwCheckPoint++; + + + // Report the status of the service to the service control manager. + // + if (!(fResult = SetServiceStatus(sshStatusHandle, &ssStatus))) + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "SetServiceStatus failed."); + } + return fResult; +} + + +/////////////////////////////////////////////////////////////////// +// +// The following code handles service installation and removal +// +// +void CmdInstallService(LPCSTR name) +{ + SC_HANDLE schService; + SC_HANDLE schSCManager; + + char szPath[256]; + + if ( GetModuleFileName( NULL, szPath, 256 ) == 0 ) + { + printf("Unable to install %s - %s\n", name, GetLastErrorText(szErr, 256)); + return; + } + + string dispName = string("Shibboleth ") + PACKAGE_VERSION + " Daemon (" + name + ")"; + string realName = string("shibd_") + name; + string cmd(szPath); + if (shar_prefix) + cmd = cmd + " -prefix " + shar_prefix; + if (shar_config) + cmd = cmd + " -config " + shar_config; + if (shar_schemadir) + cmd = cmd + " -schemadir " + shar_schemadir; + + schSCManager = OpenSCManager( + NULL, // machine (NULL == local) + NULL, // database (NULL == default) + SC_MANAGER_ALL_ACCESS // access required + ); + + + if ( schSCManager ) + { + schService = CreateService( + schSCManager, // SCManager database + realName.c_str(), // name of service + dispName.c_str(), // name to display + SERVICE_ALL_ACCESS, // desired access + SERVICE_WIN32_OWN_PROCESS, // service type + SERVICE_AUTO_START, // start type + SERVICE_ERROR_NORMAL, // error control type + cmd.c_str(), // service's command line + NULL, // no load ordering group + NULL, // no tag identifier + NULL, // dependencies + NULL, // LocalSystem account + NULL); // no password + + if ( schService ) + { + printf("%s installed.\n", realName.c_str()); + CloseServiceHandle(schService); + } + else + { + printf("CreateService failed - %s\n", GetLastErrorText(szErr, 256)); + } + + CloseServiceHandle(schSCManager); + } + else + printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr,256)); +} + +void CmdRemoveService(LPCSTR name) +{ + SC_HANDLE schService; + SC_HANDLE schSCManager; + char realName[512]; + + _snprintf(realName,sizeof(realName),"shibd_%s",name); + + schSCManager = OpenSCManager( + NULL, // machine (NULL == local) + NULL, // database (NULL == default) + SC_MANAGER_ALL_ACCESS // access required + ); + if ( schSCManager ) + { + schService = OpenService(schSCManager, realName, SERVICE_ALL_ACCESS); + + if (schService) + { + // try to stop the service + if ( ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus ) ) + { + printf("Stopping shibd (%s).", name); + Sleep( 1000 ); + + while( QueryServiceStatus( schService, &ssStatus ) ) + { + if ( ssStatus.dwCurrentState == SERVICE_STOP_PENDING ) + { + printf("."); + Sleep( 1000 ); + } + else + break; + } + + if ( ssStatus.dwCurrentState == SERVICE_STOPPED ) + printf("\n%s stopped.\n", realName); + else + printf("\n%s failed to stop.\n", realName); + + } + + // now remove the service + if( DeleteService(schService) ) + printf("%s removed.\n", realName); + else + printf("DeleteService failed - %s\n", GetLastErrorText(szErr,256)); + + + CloseServiceHandle(schService); + } + else + printf("OpenService failed - %s\n", GetLastErrorText(szErr,256)); + + CloseServiceHandle(schSCManager); + } + else + printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr,256)); +} + + +// +// FUNCTION: GetLastErrorText +// +// PURPOSE: copies error message text to string +// +// PARAMETERS: +// lpszBuf - destination buffer +// dwSize - size of buffer +// +// RETURN VALUE: +// destination buffer +// +// COMMENTS: +// +LPTSTR GetLastErrorText( LPSTR lpszBuf, DWORD dwSize ) +{ + DWORD dwRet; + LPSTR lpszTemp = NULL; + + dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY, + NULL, + GetLastError(), + LANG_NEUTRAL, + (LPSTR)&lpszTemp, + 0, + NULL ); + + // supplied buffer is not long enough + if ( !dwRet || ( (long)dwSize < (long)dwRet+14 ) ) + lpszBuf[0] = '\0'; + else + { + lpszTemp[lstrlen(lpszTemp)-2] = '\0'; //remove cr and newline character + sprintf( lpszBuf, "%s (0x%x)", lpszTemp, GetLastError() ); + } + + if ( lpszTemp ) + LocalFree((HLOCAL) lpszTemp ); + + return lpszBuf; +} + +BOOL LogEvent( + LPCSTR lpUNCServerName, + WORD wType, + DWORD dwEventID, + PSID lpUserSid, + LPCSTR message) +{ + LPCSTR messages[] = {message, NULL}; + + HANDLE hElog = RegisterEventSource(lpUNCServerName, "Shibboleth Daemon"); + BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL); + return (DeregisterEventSource(hElog) && res); +} diff --git a/shibsp/AbstractSPRequest.cpp b/shibsp/AbstractSPRequest.cpp new file mode 100644 index 0000000..e7de1cd --- /dev/null +++ b/shibsp/AbstractSPRequest.cpp @@ -0,0 +1,301 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AbstractSPRequest.cpp + * + * Abstract base for SPRequest implementations + */ + +#include "internal.h" +#include "AbstractSPRequest.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "SessionCache.h" + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +AbstractSPRequest::AbstractSPRequest(const char* category) + : m_sp(NULL), m_mapper(NULL), m_app(NULL), m_sessionTried(false), m_session(NULL), + m_log(&Category::getInstance(category)), m_parser(NULL) +{ + m_sp=SPConfig::getConfig().getServiceProvider(); + m_sp->lock(); +} + +AbstractSPRequest::~AbstractSPRequest() +{ + if (m_session) + m_session->unlock(); + if (m_mapper) + m_mapper->unlock(); + if (m_sp) + m_sp->unlock(); + delete m_parser; +} + +RequestMapper::Settings AbstractSPRequest::getRequestSettings() const +{ + if (m_mapper) + return m_settings; + + // Map request to application and content settings. + m_mapper=m_sp->getRequestMapper(); + m_mapper->lock(); + return m_settings = m_mapper->getSettings(*this); + +} + +const Application& AbstractSPRequest::getApplication() const +{ + if (!m_app) { + // Now find the application from the URL settings + m_app=m_sp->getApplication(getRequestSettings().first->getString("applicationId").second); + if (!m_app) + throw ConfigurationException("Unable to map request to application settings, check configuration."); + } + return *m_app; +} + +Session* AbstractSPRequest::getSession(bool checkTimeout, bool ignoreAddress, bool cache) const +{ + // Only attempt this once. + if (cache && m_sessionTried) + return m_session; + else if (cache) + m_sessionTried = true; + + // Need address checking and timeout settings. + time_t timeout=0; + if (checkTimeout || !ignoreAddress) { + const PropertySet* props=getApplication().getPropertySet("Sessions"); + if (props) { + if (checkTimeout) { + pair p=props->getUnsignedInt("timeout"); + if (p.first) + timeout = p.second; + } + pair pcheck=props->getBool("consistentAddress"); + if (pcheck.first) + ignoreAddress = !pcheck.second; + } + } + + // The cache will either silently pass a session or NULL back, or throw an exception out. + Session* session = getServiceProvider().getSessionCache()->find( + getApplication(), *this, ignoreAddress ? NULL : getRemoteAddr().c_str(), checkTimeout ? &timeout : NULL + ); + if (cache) + m_session = session; + return session; +} + +static char _x2c(const char *what) +{ + register char digit; + + digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 : (what[0] - '0')); + digit *= 16; + digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 : (what[1] - '0')); + return(digit); +} + +void AbstractSPRequest::setRequestURI(const char* uri) +{ + // Fix for bug 574, secadv 20061002 + // Unescape URI up to query string delimiter by looking for %XX escapes. + // Adapted from Apache's util.c, ap_unescape_url function. + if (uri) { + while (*uri) { + if (*uri == '?') { + m_uri += uri; + break; + } + else if (*uri == ';') { + // If this is Java being stupid, skip everything up to the query string, if any. + if (!strncmp(uri, ";jsessionid=", 12)) { + if (uri = strchr(uri, '?')) + m_uri += uri; + break; + } + else { + m_uri += *uri; + } + } + else if (*uri != '%') { + m_uri += *uri; + } + else { + ++uri; + if (!isxdigit(*uri) || !isxdigit(*(uri+1))) + throw ConfigurationException("Bad request, contained unsupported encoded characters."); + m_uri += _x2c(uri); + ++uri; + } + ++uri; + } + } +} + +const char* AbstractSPRequest::getRequestURL() const +{ + if (m_url.empty()) { + // Compute the full target URL + int port = getPort(); + const char* scheme = getScheme(); + m_url = string(scheme) + "://" + getHostname(); + if ((!strcmp(scheme,"http") && port!=80) || (!strcmp(scheme,"https") && port!=443)) { + ostringstream portstr; + portstr << port; + m_url += ":" + portstr.str(); + } + m_url += m_uri; + } + return m_url.c_str(); +} + +const char* AbstractSPRequest::getParameter(const char* name) const +{ + if (!m_parser) + m_parser=new CGIParser(*this); + + pair bounds=m_parser->getParameters(name); + return (bounds.first==bounds.second) ? NULL : bounds.first->second; +} + +vector::size_type AbstractSPRequest::getParameters(const char* name, vector& values) const +{ + if (!m_parser) + m_parser=new CGIParser(*this); + + pair bounds=m_parser->getParameters(name); + while (bounds.first!=bounds.second) { + values.push_back(bounds.first->second); + ++bounds.first; + } + return values.size(); +} + +const char* AbstractSPRequest::getHandlerURL(const char* resource) const +{ + if (!resource) + resource = getRequestURL(); + + if (!m_handlerURL.empty() && resource && !strcmp(getRequestURL(),resource)) + return m_handlerURL.c_str(); + +#ifdef HAVE_STRCASECMP + if (!resource || (strncasecmp(resource,"http://",7) && strncasecmp(resource,"https://",8))) +#else + if (!resource || (strnicmp(resource,"http://",7) && strnicmp(resource,"https://",8))) +#endif + throw ConfigurationException("Target resource was not an absolute URL."); + + bool ssl_only=false; + const char* handler=NULL; + const PropertySet* props=m_app->getPropertySet("Sessions"); + if (props) { + pair p=props->getBool("handlerSSL"); + if (p.first) + ssl_only=p.second; + pair p2=props->getString("handlerURL"); + if (p2.first) + handler=p2.second; + } + + // Should never happen... + if (!handler || (*handler!='/' && strncmp(handler,"http:",5) && strncmp(handler,"https:",6))) + throw ConfigurationException( + "Invalid handlerURL property ($1) in Application ($2)", + params(2, handler ? handler : "null", m_app->getId()) + ); + + // The "handlerURL" property can be in one of three formats: + // + // 1) a full URI: http://host/foo/bar + // 2) a hostless URI: http:///foo/bar + // 3) a relative path: /foo/bar + // + // # Protocol Host Path + // 1 handler handler handler + // 2 handler resource handler + // 3 resource resource handler + // + // note: if ssl_only is true, make sure the protocol is https + + const char* path = NULL; + + // Decide whether to use the handler or the resource for the "protocol" + const char* prot; + if (*handler != '/') { + prot = handler; + } + else { + prot = resource; + path = handler; + } + + // break apart the "protocol" string into protocol, host, and "the rest" + const char* colon=strchr(prot,':'); + colon += 3; + const char* slash=strchr(colon,'/'); + if (!path) + path = slash; + + // Compute the actual protocol and store in member. + if (ssl_only) + m_handlerURL.assign("https://"); + else + m_handlerURL.assign(prot, colon-prot); + + // create the "host" from either the colon/slash or from the target string + // If prot == handler then we're in either #1 or #2, else #3. + // If slash == colon then we're in #2. + if (prot != handler || slash == colon) { + colon = strchr(resource, ':'); + colon += 3; // Get past the :// + slash = strchr(colon, '/'); + } + string host(colon, (slash ? slash-colon : strlen(colon))); + + // Build the handler URL + m_handlerURL += host + path; + return m_handlerURL.c_str(); +} + +void AbstractSPRequest::log(SPLogLevel level, const std::string& msg) const +{ + reinterpret_cast(m_log)->log( + (level == SPDebug ? Priority::DEBUG : + (level == SPInfo ? Priority::INFO : + (level == SPWarn ? Priority::WARN : + (level == SPError ? Priority::ERROR : Priority::CRIT)))), + msg + ); +} + +bool AbstractSPRequest::isPriorityEnabled(SPLogLevel level) const +{ + return reinterpret_cast(m_log)->isPriorityEnabled( + (level == SPDebug ? Priority::DEBUG : + (level == SPInfo ? Priority::INFO : + (level == SPWarn ? Priority::WARN : + (level == SPError ? Priority::ERROR : Priority::CRIT)))) + ); +} diff --git a/shibsp/AbstractSPRequest.h b/shibsp/AbstractSPRequest.h new file mode 100644 index 0000000..adec1c0 --- /dev/null +++ b/shibsp/AbstractSPRequest.h @@ -0,0 +1,107 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/AbstractSPRequest.h + * + * Abstract base for SPRequest implementations + */ + +#ifndef __shibsp_abstreq_h__ +#define __shibsp_abstreq_h__ + +#include +#include +#include + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + + /** + * Abstract base for SPRequest implementations + */ + class SHIBSP_API AbstractSPRequest : public virtual SPRequest + { + protected: + /** + * Constructor. + * + * @param category logging category to use + */ + AbstractSPRequest(const char* category); + + /** + * Stores a normalized request URI to ensure it contains no %-encoded characters + * or other undesirable artifacts, such as ;jsessionid appendage. + * + * @param uri the request URI as obtained from the client + */ + void setRequestURI(const char* uri); + + public: + virtual ~AbstractSPRequest(); + + const ServiceProvider& getServiceProvider() const { + return *m_sp; + } + + RequestMapper::Settings getRequestSettings() const; + + const Application& getApplication() const; + + Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true) const; + + const char* getRequestURI() const { + return m_uri.c_str(); + } + + const char* getRequestURL() const; + + const char* getParameter(const char* name) const; + + std::vector::size_type getParameters(const char* name, std::vector& values) const; + + const char* getHandlerURL(const char* resource=NULL) const; + + void log(SPLogLevel level, const std::string& msg) const; + + bool isPriorityEnabled(SPLogLevel level) const; + + private: + ServiceProvider* m_sp; + mutable RequestMapper* m_mapper; + mutable RequestMapper::Settings m_settings; + mutable const Application* m_app; + mutable bool m_sessionTried; + mutable Session* m_session; + std::string m_uri; + mutable std::string m_url; + void* m_log; // declared void* to avoid log4cpp header conflicts in Apache + mutable std::string m_handlerURL; + mutable CGIParser* m_parser; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_abstreq_h__ */ diff --git a/shibsp/AccessControl.h b/shibsp/AccessControl.h new file mode 100644 index 0000000..77774b6 --- /dev/null +++ b/shibsp/AccessControl.h @@ -0,0 +1,80 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/AccessControl.h + * + * Interface to an access control plugin + */ + +#ifndef __shibsp_acl_h__ +#define __shibsp_acl_h__ + +#include +#include + +namespace shibsp { + + class SHIBSP_API Session; + class SHIBSP_API SPRequest; + + /** + * Interface to an access control plugin + * + * Access control plugins return authorization decisions based on the intersection + * of the resource request and the active session. They can be implemented through + * cross-platform or platform-specific mechanisms. + */ + class SHIBSP_API AccessControl : public virtual xmltooling::Lockable + { + MAKE_NONCOPYABLE(AccessControl); + protected: + AccessControl() {} + public: + virtual ~AccessControl() {} + + /** + * Possible results from an access control decision. + */ + enum aclresult_t { + shib_acl_true, + shib_acl_false, + shib_acl_indeterminate + }; + + /** + * Perform an authorization check. + * + * @param request SP request information + * @param session active user session, if any + * @return true iff access should be granted + */ + virtual aclresult_t authorized(const SPRequest& request, const Session* session) const=0; + }; + + /** + * Registers AccessControl classes into the runtime. + */ + void SHIBSP_API registerAccessControls(); + + /** AccessControl based on rudimentary XML syntax. */ + #define XML_ACCESS_CONTROL "XML" + + /** Reserved for Apache-style .htaccess support. */ + #define HT_ACCESS_CONTROL "htaccess" +}; + +#endif /* __shibsp_acl_h__ */ diff --git a/shibsp/Application.cpp b/shibsp/Application.cpp new file mode 100644 index 0000000..9457bfd --- /dev/null +++ b/shibsp/Application.cpp @@ -0,0 +1,101 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Application.cpp + * + * Interface to a Shibboleth Application instance. + */ + +#include "internal.h" +#include "Application.h" +#include "SPRequest.h" +#include "ServiceProvider.h" +#include "attribute/Attribute.h" +#include "remoting/ListenerService.h" + +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +Application::Application(const ServiceProvider* sp) : m_sp(sp), m_lock(RWLock::create()) +{ +} + +Application::~Application() +{ + delete m_lock; +} + +pair Application::getCookieNameProps(const char* prefix) const +{ + static const char* defProps="; path=/"; + + const PropertySet* props=getPropertySet("Sessions"); + if (props) { + pair p=props->getString("cookieProps"); + if (!p.first) + p.second=defProps; + pair p2=props->getString("cookieName"); + if (p2.first) + return make_pair(string(prefix) + p2.second,p.second); + return make_pair(string(prefix) + getHash(),p.second); + } + + // Shouldn't happen, but just in case.. + return pair(prefix,defProps); +} + +void Application::clearAttributeHeaders(SPRequest& request) const +{ + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + for (vector< pair >::const_iterator i = m_unsetHeaders.begin(); i!=m_unsetHeaders.end(); ++i) + request.clearHeader(i->first.c_str(), i->second.c_str()); + return; + } + + m_lock->rdlock(); + if (m_unsetHeaders.empty()) { + // No headers yet, so we have to request them from the remote half. + m_lock->unlock(); + m_lock->wrlock(); + if (m_unsetHeaders.empty()) { + SharedLock wrlock(m_lock, false); + string addr=string(getId()) + "::getHeaders::Application"; + DDF out,in = DDF(addr.c_str()); + DDFJanitor jin(in),jout(out); + out = getServiceProvider().getListenerService()->send(in); + if (out.islist()) { + DDF header = out.first(); + while (header.isstring()) { + m_unsetHeaders.push_back(pair(header.name(),header.string())); + header = out.next(); + } + } + } + else { + m_lock->unlock(); + } + m_lock->rdlock(); + } + + // Now holding read lock. + SharedLock unsetLock(m_lock, false); + for (vector< pair >::const_iterator i = m_unsetHeaders.begin(); i!=m_unsetHeaders.end(); ++i) + request.clearHeader(i->first.c_str(), i->second.c_str()); +} diff --git a/shibsp/Application.h b/shibsp/Application.h new file mode 100644 index 0000000..9660e7a --- /dev/null +++ b/shibsp/Application.h @@ -0,0 +1,270 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/Application.h + * + * Interface to a Shibboleth Application instance. + */ + +#ifndef __shibsp_app_h__ +#define __shibsp_app_h__ + +#include + +#include +#ifndef SHIBSP_LITE +# include +# include +# include +# include +#endif +#include +#include + +namespace shibsp { + +#ifndef SHIBSP_LITE + class SHIBSP_API AttributeExtractor; + class SHIBSP_API AttributeFilter; + class SHIBSP_API AttributeResolver; +#endif + class SHIBSP_API Attribute; + class SHIBSP_API Handler; + class SHIBSP_API ServiceProvider; + class SHIBSP_API SessionInitiator; + class SHIBSP_API SPRequest; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + + /** + * Interface to a Shibboleth Application instance. + * + *

An Application is a logical set of resources that act as a unit + * of session management and policy. + */ + class SHIBSP_API Application : public virtual PropertySet +#ifndef SHIBSP_LITE + ,public virtual opensaml::MessageEncoder::ArtifactGenerator +#endif + { + MAKE_NONCOPYABLE(Application); + protected: + /** + * Constructor. + * + * @param sp parent ServiceProvider instance + */ + Application(const ServiceProvider* sp); + + /** Pointer to parent SP instance. */ + const ServiceProvider* m_sp; + + /** Shared lock for manipulating application state. */ + mutable xmltooling::RWLock* m_lock; + + /** Pairs of raw and normalized CGI header names to clear. */ + mutable std::vector< std::pair > m_unsetHeaders; + + public: + virtual ~Application(); + + /** + * Returns the owning ServiceProvider instance. + * + * @return a locked ServiceProvider + */ + const ServiceProvider& getServiceProvider() const { + return *m_sp; + } + + /** + * Returns the Application's ID. + * + * @return the ID + */ + virtual const char* getId() const { + return getString("id").second; + } + + /** + * Returns a unique hash for the Application. + * + * @return a value resulting from a computation over the Application's configuration + */ + virtual const char* getHash() const=0; + + /** + * Returns the name and cookie properties to use for this Application. + * + * @param prefix a value to prepend to the base cookie name + * @return a pair containing the cookie name and the string to append to the cookie value + */ + virtual std::pair getCookieNameProps(const char* prefix) const; + +#ifndef SHIBSP_LITE + /** + * Returns a MetadataProvider for use with this Application. + * + * @param required true iff an exception should be thrown if no MetadataProvider is available + * @return a MetadataProvider instance, or NULL + */ + virtual opensaml::saml2md::MetadataProvider* getMetadataProvider(bool required=true) const=0; + + /** + * Returns a TrustEngine for use with this Application. + * + * @param required true iff an exception should be thrown if no TrustEngine is available + * @return a TrustEngine instance, or NULL + */ + virtual xmltooling::TrustEngine* getTrustEngine(bool required=true) const=0; + + /** + * Returns an AttributeExtractor for use with this Application. + * + * @return an AttributeExtractor, or NULL + */ + virtual AttributeExtractor* getAttributeExtractor() const=0; + + /** + * Returns an AttributeFilter for use with this Application. + * + * @return an AttributeFilter, or NULL + */ + virtual AttributeFilter* getAttributeFilter() const=0; + + /** + * Returns an AttributeResolver for use with this Application. + * + * @return an AttributeResolver, or NULL + */ + virtual AttributeResolver* getAttributeResolver() const=0; + + /** + * Returns the CredentialResolver instance associated with this Application. + * + * @return a CredentialResolver, or NULL + */ + virtual xmltooling::CredentialResolver* getCredentialResolver() const=0; + + /** + * Returns configuration properties governing security interactions with a peer. + * + * @param provider a peer entity's metadata + * @return the applicable PropertySet + */ + virtual const PropertySet* getRelyingParty(const opensaml::saml2md::EntityDescriptor* provider) const=0; + + /** + * Returns any additional audience values associated with this Application. + * + * @return additional audience values associated with the Application, or NULL + */ + virtual const std::vector* getAudiences() const=0; +#endif + + /** + * Returns the designated notification URL, or an empty string if no more locations are specified. + * + * @param request requested URL to use to fill in missing pieces of notification URL + * @param front true iff front channel notification is desired, false iff back channel is desired + * @param index zero-based index of URL to return + * @return the designated URL, or an empty string + */ + virtual std::string getNotificationURL(const char* request, bool front, unsigned int index) const=0; + + /** + * Returns an array of attribute IDs to use as a REMOTE_USER value, in order of preference. + * + * @return an array of attribute IDs, possibly empty + */ + virtual const std::vector& getRemoteUserAttributeIds() const=0; + + /** + * Clears any headers that may be used to hold attributes after export. + * + * @param request SP request to clear + */ + virtual void clearAttributeHeaders(SPRequest& request) const; + + /** + * Returns the default SessionInitiator when automatically requesting a session. + * + * @return the default SessionInitiator, or NULL + */ + virtual const SessionInitiator* getDefaultSessionInitiator() const=0; + + /** + * Returns a SessionInitiator with a particular ID when automatically requesting a session. + * + * @param id an identifier unique to the Application + * @return the designated SessionInitiator, or NULL + */ + virtual const SessionInitiator* getSessionInitiatorById(const char* id) const=0; + + /** + * Returns the default AssertionConsumerService Handler + * for use in AuthnRequest messages. + * + * @return the default AssertionConsumerService, or NULL + */ + virtual const Handler* getDefaultAssertionConsumerService() const=0; + + /** + * Returns an AssertionConsumerService Handler with a particular index + * for use in AuthnRequest messages. + * + * @param index an index unique to an application + * @return the designated AssertionConsumerService, or NULL + */ + virtual const Handler* getAssertionConsumerServiceByIndex(unsigned short index) const=0; + + /** + * Returns one or more AssertionConsumerService Handlers that support + * a particular protocol binding. + * + * @param binding a protocol binding identifier + * @return a set of qualifying AssertionConsumerServices + */ + virtual const std::vector& getAssertionConsumerServicesByBinding(const XMLCh* binding) const=0; + + /** + * Returns the Handler associated with a particular path/location. + * + * @param path the PATH_INFO appended to the end of a base Handler location + * that invokes the Handler + * @return the mapped Handler, or NULL + */ + virtual const Handler* getHandler(const char* path) const=0; + + /** + * Returns all registered Handlers. + * + * @param handlers array to populate + */ + virtual void getHandlers(std::vector& handlers) const=0; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_app_h__ */ diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am new file mode 100644 index 0000000..cd1d348 --- /dev/null +++ b/shibsp/Makefile.am @@ -0,0 +1,212 @@ +AUTOMAKE_OPTIONS = foreign + +pkgsysconfdir = $(sysconfdir)/@PACKAGE@ +pkgxmldir = $(datadir)/xml/@PACKAGE@ + +lib_LTLIBRARIES = libshibsp.la libshibsp-lite.la + +libshibspincludedir = $(includedir)/shibsp + +attrincludedir = $(includedir)/shibsp/attribute + +attrresincludedir = $(includedir)/shibsp/attribute/resolver + +attrfiltincludedir = $(includedir)/shibsp/attribute/filtering + +bindincludedir = $(includedir)/shibsp/binding + +handincludedir = $(includedir)/shibsp/handler + +liteincludedir = $(includedir)/shibsp/lite + +mdincludedir = $(includedir)/shibsp/metadata + +remincludedir = $(includedir)/shibsp/remoting + +secincludedir = $(includedir)/shibsp/security + +utilincludedir = $(includedir)/shibsp/util + +libshibspinclude_HEADERS = \ + AbstractSPRequest.h \ + AccessControl.h \ + Application.h \ + base.h \ + exceptions.h \ + paths.h \ + RequestMapper.h \ + ServiceProvider.h \ + SessionCache.h \ + SessionCacheEx.h \ + SPConfig.h \ + SPRequest.h \ + TransactionLog.h \ + version.h + +attrinclude_HEADERS = \ + attribute/Attribute.h \ + attribute/AttributeDecoder.h \ + attribute/NameIDAttribute.h \ + attribute/ScopedAttribute.h \ + attribute/SimpleAttribute.h + +attrfiltinclude_HEADERS = \ + attribute/filtering/AttributeFilter.h \ + attribute/filtering/BasicFilteringContext.h \ + attribute/filtering/FilteringContext.h \ + attribute/filtering/FilterPolicyContext.h \ + attribute/filtering/MatchFunctor.h + +attrresinclude_HEADERS = \ + attribute/resolver/AttributeExtractor.h \ + attribute/resolver/AttributeResolver.h \ + attribute/resolver/ResolutionContext.h + +bindinclude_HEADERS = \ + binding/ArtifactResolver.h \ + binding/SOAPClient.h + +handinclude_HEADERS = \ + handler/AbstractHandler.h \ + handler/AssertionConsumerService.h \ + handler/Handler.h \ + handler/LogoutHandler.h \ + handler/RemotedHandler.h \ + handler/SessionInitiator.h + +liteinclude_HEADERS = \ + lite/CommonDomainCookie.h \ + lite/SAMLConstants.h + +mdinclude_HEADERS = \ + metadata/MetadataExt.h + +reminclude_HEADERS = \ + remoting/ddf.h \ + remoting/ListenerService.h + +secinclude_HEADERS = \ + security/PKIXTrustEngine.h \ + security/SecurityPolicy.h + +utilinclude_HEADERS = \ + util/CGIParser.h \ + util/DOMPropertySet.h \ + util/PropertySet.h \ + util/SPConstants.h \ + util/TemplateParameters.h + +noinst_HEADERS = \ + internal.h \ + remoting/impl/SocketListener.h + +common_sources = \ + AbstractSPRequest.cpp \ + Application.cpp \ + ServiceProvider.cpp \ + SPConfig.cpp \ + attribute/Attribute.cpp \ + handler/impl/AbstractHandler.cpp \ + handler/impl/AssertionConsumerService.cpp \ + handler/impl/AssertionLookup.cpp \ + handler/impl/ChainingLogoutInitiator.cpp \ + handler/impl/ChainingSessionInitiator.cpp \ + handler/impl/CookieSessionInitiator.cpp \ + handler/impl/FormSessionInitiator.cpp \ + handler/impl/LocalLogoutInitiator.cpp \ + handler/impl/LogoutHandler.cpp \ + handler/impl/MetadataGenerator.cpp \ + handler/impl/RemotedHandler.cpp \ + handler/impl/StatusHandler.cpp \ + handler/impl/SessionHandler.cpp \ + handler/impl/SAML1Consumer.cpp \ + handler/impl/SAML2Consumer.cpp \ + handler/impl/SAML2ArtifactResolution.cpp \ + handler/impl/SAML2Logout.cpp \ + handler/impl/SAML2LogoutInitiator.cpp \ + handler/impl/SAML2NameIDMgmt.cpp \ + handler/impl/SAML2SessionInitiator.cpp \ + handler/impl/SAMLDSSessionInitiator.cpp \ + handler/impl/SessionInitiator.cpp \ + handler/impl/Shib1SessionInitiator.cpp \ + handler/impl/TransformSessionInitiator.cpp \ + handler/impl/WAYFSessionInitiator.cpp \ + impl/StorageServiceSessionCache.cpp \ + impl/XMLAccessControl.cpp \ + impl/XMLRequestMapper.cpp \ + impl/XMLServiceProvider.cpp \ + remoting/impl/ddf.cpp \ + remoting/impl/ListenerService.cpp \ + remoting/impl/SocketListener.cpp \ + remoting/impl/TCPListener.cpp \ + remoting/impl/UnixListener.cpp \ + util/CGIParser.cpp \ + util/DOMPropertySet.cpp \ + util/SPConstants.cpp \ + util/TemplateParameters.cpp + +libshibsp_lite_la_SOURCES = \ + ${common_sources} \ + lite/CommonDomainCookie.cpp \ + lite/SAMLConstants.cpp + +libshibsp_la_SOURCES = \ + ${common_sources} \ + attribute/NameIDAttributeDecoder.cpp \ + attribute/ScopedAttributeDecoder.cpp \ + attribute/StringAttributeDecoder.cpp \ + attribute/filtering/impl/AttributeFilter.cpp \ + attribute/filtering/impl/ChainingAttributeFilter.cpp \ + attribute/filtering/impl/XMLAttributeFilter.cpp \ + attribute/filtering/impl/MatchFunctor.cpp \ + attribute/filtering/impl/AndMatchFunctor.cpp \ + attribute/filtering/impl/AnyMatchFunctor.cpp \ + attribute/filtering/impl/NotMatchFunctor.cpp \ + attribute/filtering/impl/OrMatchFunctor.cpp \ + attribute/filtering/impl/AttributeIssuerStringFunctor.cpp \ + attribute/filtering/impl/AttributeRequesterStringFunctor.cpp \ + attribute/filtering/impl/AttributeScopeStringFunctor.cpp \ + attribute/filtering/impl/AttributeValueStringFunctor.cpp \ + attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp \ + attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp \ + attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp \ + attribute/filtering/impl/AttributeScopeRegexFunctor.cpp \ + attribute/filtering/impl/AttributeValueRegexFunctor.cpp \ + attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp \ + attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp \ + attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp \ + attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp \ + attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp \ + attribute/resolver/impl/ChainingAttributeResolver.cpp \ + attribute/resolver/impl/QueryAttributeResolver.cpp \ + attribute/resolver/impl/ChainingAttributeExtractor.cpp \ + attribute/resolver/impl/XMLAttributeExtractor.cpp \ + binding/impl/ArtifactResolver.cpp \ + binding/impl/SOAPClient.cpp \ + metadata/MetadataExtImpl.cpp \ + metadata/MetadataExtSchemaValidators.cpp \ + security/PKIXTrustEngine.cpp \ + security/SecurityPolicy.cpp + +# this is different from the project version +# http://sources.redhat.com/autobook/autobook/autobook_91.html +libshibsp_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0 +libshibsp_lite_la_LDFLAGS = $(LITE_LIBS) -version-info 1:0:0 +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' \ + -e 's:@-OPENSAMLXMLDIR-@:${OPENSAMLXMLDIR}:g' + cmp -s $@ $@.tmp || mv $@.tmp $@ + rm -f $@.tmp + +install-exec-hook: + for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done + +EXTRA_DIST = shibsp.vcproj shibsp-lite.vcproj paths.h.in resource.h shibsp.rc +BUILT_SOURCES = paths.h diff --git a/shibsp/Makefile.in b/shibsp/Makefile.in new file mode 100644 index 0000000..59e2edc --- /dev/null +++ b/shibsp/Makefile.in @@ -0,0 +1,2031 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = shibsp +DIST_COMMON = $(attrfiltinclude_HEADERS) $(attrinclude_HEADERS) \ + $(attrresinclude_HEADERS) $(bindinclude_HEADERS) \ + $(handinclude_HEADERS) $(libshibspinclude_HEADERS) \ + $(liteinclude_HEADERS) $(mdinclude_HEADERS) $(noinst_HEADERS) \ + $(reminclude_HEADERS) $(secinclude_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(utilinclude_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(attrfiltincludedir)" \ + "$(DESTDIR)$(attrincludedir)" "$(DESTDIR)$(attrresincludedir)" \ + "$(DESTDIR)$(bindincludedir)" "$(DESTDIR)$(handincludedir)" \ + "$(DESTDIR)$(libshibspincludedir)" \ + "$(DESTDIR)$(liteincludedir)" "$(DESTDIR)$(mdincludedir)" \ + "$(DESTDIR)$(remincludedir)" "$(DESTDIR)$(secincludedir)" \ + "$(DESTDIR)$(utilincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libshibsp_lite_la_LIBADD = +am__objects_1 = libshibsp_lite_la-AbstractSPRequest.lo \ + libshibsp_lite_la-Application.lo \ + libshibsp_lite_la-ServiceProvider.lo \ + libshibsp_lite_la-SPConfig.lo libshibsp_lite_la-Attribute.lo \ + libshibsp_lite_la-AbstractHandler.lo \ + libshibsp_lite_la-AssertionConsumerService.lo \ + libshibsp_lite_la-AssertionLookup.lo \ + libshibsp_lite_la-ChainingLogoutInitiator.lo \ + libshibsp_lite_la-ChainingSessionInitiator.lo \ + libshibsp_lite_la-CookieSessionInitiator.lo \ + libshibsp_lite_la-FormSessionInitiator.lo \ + libshibsp_lite_la-LocalLogoutInitiator.lo \ + libshibsp_lite_la-LogoutHandler.lo \ + libshibsp_lite_la-MetadataGenerator.lo \ + libshibsp_lite_la-RemotedHandler.lo \ + libshibsp_lite_la-StatusHandler.lo \ + libshibsp_lite_la-SessionHandler.lo \ + libshibsp_lite_la-SAML1Consumer.lo \ + libshibsp_lite_la-SAML2Consumer.lo \ + libshibsp_lite_la-SAML2ArtifactResolution.lo \ + libshibsp_lite_la-SAML2Logout.lo \ + libshibsp_lite_la-SAML2LogoutInitiator.lo \ + libshibsp_lite_la-SAML2NameIDMgmt.lo \ + libshibsp_lite_la-SAML2SessionInitiator.lo \ + libshibsp_lite_la-SAMLDSSessionInitiator.lo \ + libshibsp_lite_la-SessionInitiator.lo \ + libshibsp_lite_la-Shib1SessionInitiator.lo \ + libshibsp_lite_la-TransformSessionInitiator.lo \ + libshibsp_lite_la-WAYFSessionInitiator.lo \ + libshibsp_lite_la-StorageServiceSessionCache.lo \ + libshibsp_lite_la-XMLAccessControl.lo \ + libshibsp_lite_la-XMLRequestMapper.lo \ + libshibsp_lite_la-XMLServiceProvider.lo \ + libshibsp_lite_la-ddf.lo libshibsp_lite_la-ListenerService.lo \ + libshibsp_lite_la-SocketListener.lo \ + libshibsp_lite_la-TCPListener.lo \ + libshibsp_lite_la-UnixListener.lo \ + libshibsp_lite_la-CGIParser.lo \ + libshibsp_lite_la-DOMPropertySet.lo \ + libshibsp_lite_la-SPConstants.lo \ + libshibsp_lite_la-TemplateParameters.lo +am_libshibsp_lite_la_OBJECTS = $(am__objects_1) \ + libshibsp_lite_la-CommonDomainCookie.lo \ + libshibsp_lite_la-SAMLConstants.lo +libshibsp_lite_la_OBJECTS = $(am_libshibsp_lite_la_OBJECTS) +libshibsp_la_LIBADD = +am__objects_2 = AbstractSPRequest.lo Application.lo ServiceProvider.lo \ + SPConfig.lo Attribute.lo AbstractHandler.lo \ + AssertionConsumerService.lo AssertionLookup.lo \ + ChainingLogoutInitiator.lo ChainingSessionInitiator.lo \ + CookieSessionInitiator.lo FormSessionInitiator.lo \ + LocalLogoutInitiator.lo LogoutHandler.lo MetadataGenerator.lo \ + RemotedHandler.lo StatusHandler.lo SessionHandler.lo \ + SAML1Consumer.lo SAML2Consumer.lo SAML2ArtifactResolution.lo \ + SAML2Logout.lo SAML2LogoutInitiator.lo SAML2NameIDMgmt.lo \ + SAML2SessionInitiator.lo SAMLDSSessionInitiator.lo \ + SessionInitiator.lo Shib1SessionInitiator.lo \ + TransformSessionInitiator.lo WAYFSessionInitiator.lo \ + StorageServiceSessionCache.lo XMLAccessControl.lo \ + XMLRequestMapper.lo XMLServiceProvider.lo ddf.lo \ + ListenerService.lo SocketListener.lo TCPListener.lo \ + UnixListener.lo CGIParser.lo DOMPropertySet.lo SPConstants.lo \ + TemplateParameters.lo +am_libshibsp_la_OBJECTS = $(am__objects_2) NameIDAttributeDecoder.lo \ + ScopedAttributeDecoder.lo StringAttributeDecoder.lo \ + AttributeFilter.lo ChainingAttributeFilter.lo \ + XMLAttributeFilter.lo MatchFunctor.lo AndMatchFunctor.lo \ + AnyMatchFunctor.lo NotMatchFunctor.lo OrMatchFunctor.lo \ + AttributeIssuerStringFunctor.lo \ + AttributeRequesterStringFunctor.lo \ + AttributeScopeStringFunctor.lo AttributeValueStringFunctor.lo \ + AuthenticationMethodStringFunctor.lo \ + AttributeIssuerRegexFunctor.lo \ + AttributeRequesterRegexFunctor.lo \ + AttributeScopeRegexFunctor.lo AttributeValueRegexFunctor.lo \ + AuthenticationMethodRegexFunctor.lo \ + NumberOfAttributeValuesFunctor.lo \ + AttributeIssuerInEntityGroupFunctor.lo \ + AttributeRequesterInEntityGroupFunctor.lo \ + AttributeScopeMatchesShibMDScopeFunctor.lo \ + ChainingAttributeResolver.lo QueryAttributeResolver.lo \ + ChainingAttributeExtractor.lo XMLAttributeExtractor.lo \ + ArtifactResolver.lo SOAPClient.lo MetadataExtImpl.lo \ + MetadataExtSchemaValidators.lo PKIXTrustEngine.lo \ + SecurityPolicy.lo +libshibsp_la_OBJECTS = $(am_libshibsp_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libshibsp_lite_la_SOURCES) $(libshibsp_la_SOURCES) +DIST_SOURCES = $(libshibsp_lite_la_SOURCES) $(libshibsp_la_SOURCES) +attrfiltincludeHEADERS_INSTALL = $(INSTALL_HEADER) +attrincludeHEADERS_INSTALL = $(INSTALL_HEADER) +attrresincludeHEADERS_INSTALL = $(INSTALL_HEADER) +bindincludeHEADERS_INSTALL = $(INSTALL_HEADER) +handincludeHEADERS_INSTALL = $(INSTALL_HEADER) +libshibspincludeHEADERS_INSTALL = $(INSTALL_HEADER) +liteincludeHEADERS_INSTALL = $(INSTALL_HEADER) +mdincludeHEADERS_INSTALL = $(INSTALL_HEADER) +remincludeHEADERS_INSTALL = $(INSTALL_HEADER) +secincludeHEADERS_INSTALL = $(INSTALL_HEADER) +utilincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(attrfiltinclude_HEADERS) $(attrinclude_HEADERS) \ + $(attrresinclude_HEADERS) $(bindinclude_HEADERS) \ + $(handinclude_HEADERS) $(libshibspinclude_HEADERS) \ + $(liteinclude_HEADERS) $(mdinclude_HEADERS) $(noinst_HEADERS) \ + $(reminclude_HEADERS) $(secinclude_HEADERS) \ + $(utilinclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +pkgsysconfdir = $(sysconfdir)/@PACKAGE@ +pkgxmldir = $(datadir)/xml/@PACKAGE@ +lib_LTLIBRARIES = libshibsp.la libshibsp-lite.la +libshibspincludedir = $(includedir)/shibsp +attrincludedir = $(includedir)/shibsp/attribute +attrresincludedir = $(includedir)/shibsp/attribute/resolver +attrfiltincludedir = $(includedir)/shibsp/attribute/filtering +bindincludedir = $(includedir)/shibsp/binding +handincludedir = $(includedir)/shibsp/handler +liteincludedir = $(includedir)/shibsp/lite +mdincludedir = $(includedir)/shibsp/metadata +remincludedir = $(includedir)/shibsp/remoting +secincludedir = $(includedir)/shibsp/security +utilincludedir = $(includedir)/shibsp/util +libshibspinclude_HEADERS = \ + AbstractSPRequest.h \ + AccessControl.h \ + Application.h \ + base.h \ + exceptions.h \ + paths.h \ + RequestMapper.h \ + ServiceProvider.h \ + SessionCache.h \ + SessionCacheEx.h \ + SPConfig.h \ + SPRequest.h \ + TransactionLog.h \ + version.h + +attrinclude_HEADERS = \ + attribute/Attribute.h \ + attribute/AttributeDecoder.h \ + attribute/NameIDAttribute.h \ + attribute/ScopedAttribute.h \ + attribute/SimpleAttribute.h + +attrfiltinclude_HEADERS = \ + attribute/filtering/AttributeFilter.h \ + attribute/filtering/BasicFilteringContext.h \ + attribute/filtering/FilteringContext.h \ + attribute/filtering/FilterPolicyContext.h \ + attribute/filtering/MatchFunctor.h + +attrresinclude_HEADERS = \ + attribute/resolver/AttributeExtractor.h \ + attribute/resolver/AttributeResolver.h \ + attribute/resolver/ResolutionContext.h + +bindinclude_HEADERS = \ + binding/ArtifactResolver.h \ + binding/SOAPClient.h + +handinclude_HEADERS = \ + handler/AbstractHandler.h \ + handler/AssertionConsumerService.h \ + handler/Handler.h \ + handler/LogoutHandler.h \ + handler/RemotedHandler.h \ + handler/SessionInitiator.h + +liteinclude_HEADERS = \ + lite/CommonDomainCookie.h \ + lite/SAMLConstants.h + +mdinclude_HEADERS = \ + metadata/MetadataExt.h + +reminclude_HEADERS = \ + remoting/ddf.h \ + remoting/ListenerService.h + +secinclude_HEADERS = \ + security/PKIXTrustEngine.h \ + security/SecurityPolicy.h + +utilinclude_HEADERS = \ + util/CGIParser.h \ + util/DOMPropertySet.h \ + util/PropertySet.h \ + util/SPConstants.h \ + util/TemplateParameters.h + +noinst_HEADERS = \ + internal.h \ + remoting/impl/SocketListener.h + +common_sources = \ + AbstractSPRequest.cpp \ + Application.cpp \ + ServiceProvider.cpp \ + SPConfig.cpp \ + attribute/Attribute.cpp \ + handler/impl/AbstractHandler.cpp \ + handler/impl/AssertionConsumerService.cpp \ + handler/impl/AssertionLookup.cpp \ + handler/impl/ChainingLogoutInitiator.cpp \ + handler/impl/ChainingSessionInitiator.cpp \ + handler/impl/CookieSessionInitiator.cpp \ + handler/impl/FormSessionInitiator.cpp \ + handler/impl/LocalLogoutInitiator.cpp \ + handler/impl/LogoutHandler.cpp \ + handler/impl/MetadataGenerator.cpp \ + handler/impl/RemotedHandler.cpp \ + handler/impl/StatusHandler.cpp \ + handler/impl/SessionHandler.cpp \ + handler/impl/SAML1Consumer.cpp \ + handler/impl/SAML2Consumer.cpp \ + handler/impl/SAML2ArtifactResolution.cpp \ + handler/impl/SAML2Logout.cpp \ + handler/impl/SAML2LogoutInitiator.cpp \ + handler/impl/SAML2NameIDMgmt.cpp \ + handler/impl/SAML2SessionInitiator.cpp \ + handler/impl/SAMLDSSessionInitiator.cpp \ + handler/impl/SessionInitiator.cpp \ + handler/impl/Shib1SessionInitiator.cpp \ + handler/impl/TransformSessionInitiator.cpp \ + handler/impl/WAYFSessionInitiator.cpp \ + impl/StorageServiceSessionCache.cpp \ + impl/XMLAccessControl.cpp \ + impl/XMLRequestMapper.cpp \ + impl/XMLServiceProvider.cpp \ + remoting/impl/ddf.cpp \ + remoting/impl/ListenerService.cpp \ + remoting/impl/SocketListener.cpp \ + remoting/impl/TCPListener.cpp \ + remoting/impl/UnixListener.cpp \ + util/CGIParser.cpp \ + util/DOMPropertySet.cpp \ + util/SPConstants.cpp \ + util/TemplateParameters.cpp + +libshibsp_lite_la_SOURCES = \ + ${common_sources} \ + lite/CommonDomainCookie.cpp \ + lite/SAMLConstants.cpp + +libshibsp_la_SOURCES = \ + ${common_sources} \ + attribute/NameIDAttributeDecoder.cpp \ + attribute/ScopedAttributeDecoder.cpp \ + attribute/StringAttributeDecoder.cpp \ + attribute/filtering/impl/AttributeFilter.cpp \ + attribute/filtering/impl/ChainingAttributeFilter.cpp \ + attribute/filtering/impl/XMLAttributeFilter.cpp \ + attribute/filtering/impl/MatchFunctor.cpp \ + attribute/filtering/impl/AndMatchFunctor.cpp \ + attribute/filtering/impl/AnyMatchFunctor.cpp \ + attribute/filtering/impl/NotMatchFunctor.cpp \ + attribute/filtering/impl/OrMatchFunctor.cpp \ + attribute/filtering/impl/AttributeIssuerStringFunctor.cpp \ + attribute/filtering/impl/AttributeRequesterStringFunctor.cpp \ + attribute/filtering/impl/AttributeScopeStringFunctor.cpp \ + attribute/filtering/impl/AttributeValueStringFunctor.cpp \ + attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp \ + attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp \ + attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp \ + attribute/filtering/impl/AttributeScopeRegexFunctor.cpp \ + attribute/filtering/impl/AttributeValueRegexFunctor.cpp \ + attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp \ + attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp \ + attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp \ + attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp \ + attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp \ + attribute/resolver/impl/ChainingAttributeResolver.cpp \ + attribute/resolver/impl/QueryAttributeResolver.cpp \ + attribute/resolver/impl/ChainingAttributeExtractor.cpp \ + attribute/resolver/impl/XMLAttributeExtractor.cpp \ + binding/impl/ArtifactResolver.cpp \ + binding/impl/SOAPClient.cpp \ + metadata/MetadataExtImpl.cpp \ + metadata/MetadataExtSchemaValidators.cpp \ + security/PKIXTrustEngine.cpp \ + security/SecurityPolicy.cpp + + +# this is different from the project version +# http://sources.redhat.com/autobook/autobook/autobook_91.html +libshibsp_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0 +libshibsp_lite_la_LDFLAGS = $(LITE_LIBS) -version-info 1:0:0 +libshibsp_lite_la_CPPFLAGS = -DSHIBSP_LITE +EXTRA_DIST = shibsp.vcproj shibsp-lite.vcproj paths.h.in resource.h shibsp.rc +BUILT_SOURCES = paths.h +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign shibsp/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign shibsp/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libshibsp-lite.la: $(libshibsp_lite_la_OBJECTS) $(libshibsp_lite_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libshibsp_lite_la_LDFLAGS) $(libshibsp_lite_la_OBJECTS) $(libshibsp_lite_la_LIBADD) $(LIBS) +libshibsp.la: $(libshibsp_la_OBJECTS) $(libshibsp_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libshibsp_la_LDFLAGS) $(libshibsp_la_OBJECTS) $(libshibsp_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AbstractHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AbstractSPRequest.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AndMatchFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AnyMatchFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Application.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArtifactResolver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AssertionConsumerService.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AssertionLookup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Attribute.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeFilter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeIssuerInEntityGroupFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeIssuerRegexFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeIssuerStringFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeRequesterInEntityGroupFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeRequesterRegexFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeRequesterStringFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeScopeMatchesShibMDScopeFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeScopeRegexFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeScopeStringFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeValueRegexFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttributeValueStringFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AuthenticationMethodRegexFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AuthenticationMethodStringFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CGIParser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChainingAttributeExtractor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChainingAttributeFilter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChainingAttributeResolver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChainingLogoutInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChainingSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DOMPropertySet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FormSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ListenerService.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LocalLogoutInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LogoutHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MatchFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MetadataExtImpl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MetadataExtSchemaValidators.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MetadataGenerator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NameIDAttributeDecoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NotMatchFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NumberOfAttributeValuesFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OrMatchFunctor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PKIXTrustEngine.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QueryAttributeResolver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RemotedHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAML1Consumer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAML2ArtifactResolution.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAML2Consumer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAML2Logout.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAML2LogoutInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAML2NameIDMgmt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAML2SessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAMLDSSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SOAPClient.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SPConfig.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SPConstants.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScopedAttributeDecoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SecurityPolicy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ServiceProvider.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SessionHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shib1SessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SocketListener.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StatusHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StorageServiceSessionCache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringAttributeDecoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TCPListener.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TemplateParameters.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TransformSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UnixListener.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WAYFSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XMLAccessControl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XMLAttributeExtractor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XMLAttributeFilter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XMLRequestMapper.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XMLServiceProvider.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-AbstractHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-AbstractSPRequest.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-Application.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-AssertionConsumerService.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-AssertionLookup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-Attribute.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-CGIParser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-ChainingLogoutInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-ChainingSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-CommonDomainCookie.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-CookieSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-DOMPropertySet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-FormSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-ListenerService.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-LocalLogoutInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-LogoutHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-MetadataGenerator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-RemotedHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAML1Consumer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAML2ArtifactResolution.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAML2Consumer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAML2Logout.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAML2LogoutInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAML2NameIDMgmt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAML2SessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAMLConstants.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SAMLDSSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SPConfig.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SPConstants.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-ServiceProvider.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SessionHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-Shib1SessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-SocketListener.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-StatusHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-StorageServiceSessionCache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-TCPListener.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-TemplateParameters.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-TransformSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-UnixListener.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-WAYFSessionInitiator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-XMLAccessControl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-XMLRequestMapper.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-XMLServiceProvider.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libshibsp_lite_la-ddf.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libshibsp_lite_la-AbstractSPRequest.lo: AbstractSPRequest.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-AbstractSPRequest.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-AbstractSPRequest.Tpo" -c -o libshibsp_lite_la-AbstractSPRequest.lo `test -f 'AbstractSPRequest.cpp' || echo '$(srcdir)/'`AbstractSPRequest.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-AbstractSPRequest.Tpo" "$(DEPDIR)/libshibsp_lite_la-AbstractSPRequest.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-AbstractSPRequest.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AbstractSPRequest.cpp' object='libshibsp_lite_la-AbstractSPRequest.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-AbstractSPRequest.lo `test -f 'AbstractSPRequest.cpp' || echo '$(srcdir)/'`AbstractSPRequest.cpp + +libshibsp_lite_la-Application.lo: Application.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-Application.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-Application.Tpo" -c -o libshibsp_lite_la-Application.lo `test -f 'Application.cpp' || echo '$(srcdir)/'`Application.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-Application.Tpo" "$(DEPDIR)/libshibsp_lite_la-Application.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-Application.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Application.cpp' object='libshibsp_lite_la-Application.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-Application.lo `test -f 'Application.cpp' || echo '$(srcdir)/'`Application.cpp + +libshibsp_lite_la-ServiceProvider.lo: ServiceProvider.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-ServiceProvider.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-ServiceProvider.Tpo" -c -o libshibsp_lite_la-ServiceProvider.lo `test -f 'ServiceProvider.cpp' || echo '$(srcdir)/'`ServiceProvider.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-ServiceProvider.Tpo" "$(DEPDIR)/libshibsp_lite_la-ServiceProvider.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-ServiceProvider.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ServiceProvider.cpp' object='libshibsp_lite_la-ServiceProvider.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-ServiceProvider.lo `test -f 'ServiceProvider.cpp' || echo '$(srcdir)/'`ServiceProvider.cpp + +libshibsp_lite_la-SPConfig.lo: SPConfig.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SPConfig.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SPConfig.Tpo" -c -o libshibsp_lite_la-SPConfig.lo `test -f 'SPConfig.cpp' || echo '$(srcdir)/'`SPConfig.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SPConfig.Tpo" "$(DEPDIR)/libshibsp_lite_la-SPConfig.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SPConfig.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SPConfig.cpp' object='libshibsp_lite_la-SPConfig.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SPConfig.lo `test -f 'SPConfig.cpp' || echo '$(srcdir)/'`SPConfig.cpp + +libshibsp_lite_la-Attribute.lo: attribute/Attribute.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-Attribute.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-Attribute.Tpo" -c -o libshibsp_lite_la-Attribute.lo `test -f 'attribute/Attribute.cpp' || echo '$(srcdir)/'`attribute/Attribute.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-Attribute.Tpo" "$(DEPDIR)/libshibsp_lite_la-Attribute.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-Attribute.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/Attribute.cpp' object='libshibsp_lite_la-Attribute.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-Attribute.lo `test -f 'attribute/Attribute.cpp' || echo '$(srcdir)/'`attribute/Attribute.cpp + +libshibsp_lite_la-AbstractHandler.lo: handler/impl/AbstractHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-AbstractHandler.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-AbstractHandler.Tpo" -c -o libshibsp_lite_la-AbstractHandler.lo `test -f 'handler/impl/AbstractHandler.cpp' || echo '$(srcdir)/'`handler/impl/AbstractHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-AbstractHandler.Tpo" "$(DEPDIR)/libshibsp_lite_la-AbstractHandler.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-AbstractHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/AbstractHandler.cpp' object='libshibsp_lite_la-AbstractHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-AbstractHandler.lo `test -f 'handler/impl/AbstractHandler.cpp' || echo '$(srcdir)/'`handler/impl/AbstractHandler.cpp + +libshibsp_lite_la-AssertionConsumerService.lo: handler/impl/AssertionConsumerService.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-AssertionConsumerService.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-AssertionConsumerService.Tpo" -c -o libshibsp_lite_la-AssertionConsumerService.lo `test -f 'handler/impl/AssertionConsumerService.cpp' || echo '$(srcdir)/'`handler/impl/AssertionConsumerService.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-AssertionConsumerService.Tpo" "$(DEPDIR)/libshibsp_lite_la-AssertionConsumerService.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-AssertionConsumerService.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/AssertionConsumerService.cpp' object='libshibsp_lite_la-AssertionConsumerService.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-AssertionConsumerService.lo `test -f 'handler/impl/AssertionConsumerService.cpp' || echo '$(srcdir)/'`handler/impl/AssertionConsumerService.cpp + +libshibsp_lite_la-AssertionLookup.lo: handler/impl/AssertionLookup.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-AssertionLookup.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-AssertionLookup.Tpo" -c -o libshibsp_lite_la-AssertionLookup.lo `test -f 'handler/impl/AssertionLookup.cpp' || echo '$(srcdir)/'`handler/impl/AssertionLookup.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-AssertionLookup.Tpo" "$(DEPDIR)/libshibsp_lite_la-AssertionLookup.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-AssertionLookup.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/AssertionLookup.cpp' object='libshibsp_lite_la-AssertionLookup.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-AssertionLookup.lo `test -f 'handler/impl/AssertionLookup.cpp' || echo '$(srcdir)/'`handler/impl/AssertionLookup.cpp + +libshibsp_lite_la-ChainingLogoutInitiator.lo: handler/impl/ChainingLogoutInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-ChainingLogoutInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-ChainingLogoutInitiator.Tpo" -c -o libshibsp_lite_la-ChainingLogoutInitiator.lo `test -f 'handler/impl/ChainingLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingLogoutInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-ChainingLogoutInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-ChainingLogoutInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-ChainingLogoutInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/ChainingLogoutInitiator.cpp' object='libshibsp_lite_la-ChainingLogoutInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-ChainingLogoutInitiator.lo `test -f 'handler/impl/ChainingLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingLogoutInitiator.cpp + +libshibsp_lite_la-ChainingSessionInitiator.lo: handler/impl/ChainingSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-ChainingSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-ChainingSessionInitiator.Tpo" -c -o libshibsp_lite_la-ChainingSessionInitiator.lo `test -f 'handler/impl/ChainingSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-ChainingSessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-ChainingSessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-ChainingSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/ChainingSessionInitiator.cpp' object='libshibsp_lite_la-ChainingSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-ChainingSessionInitiator.lo `test -f 'handler/impl/ChainingSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingSessionInitiator.cpp + +libshibsp_lite_la-CookieSessionInitiator.lo: handler/impl/CookieSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-CookieSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-CookieSessionInitiator.Tpo" -c -o libshibsp_lite_la-CookieSessionInitiator.lo `test -f 'handler/impl/CookieSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/CookieSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-CookieSessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-CookieSessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-CookieSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/CookieSessionInitiator.cpp' object='libshibsp_lite_la-CookieSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-CookieSessionInitiator.lo `test -f 'handler/impl/CookieSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/CookieSessionInitiator.cpp + +libshibsp_lite_la-FormSessionInitiator.lo: handler/impl/FormSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-FormSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-FormSessionInitiator.Tpo" -c -o libshibsp_lite_la-FormSessionInitiator.lo `test -f 'handler/impl/FormSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/FormSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-FormSessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-FormSessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-FormSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/FormSessionInitiator.cpp' object='libshibsp_lite_la-FormSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-FormSessionInitiator.lo `test -f 'handler/impl/FormSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/FormSessionInitiator.cpp + +libshibsp_lite_la-LocalLogoutInitiator.lo: handler/impl/LocalLogoutInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-LocalLogoutInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-LocalLogoutInitiator.Tpo" -c -o libshibsp_lite_la-LocalLogoutInitiator.lo `test -f 'handler/impl/LocalLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/LocalLogoutInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-LocalLogoutInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-LocalLogoutInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-LocalLogoutInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/LocalLogoutInitiator.cpp' object='libshibsp_lite_la-LocalLogoutInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-LocalLogoutInitiator.lo `test -f 'handler/impl/LocalLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/LocalLogoutInitiator.cpp + +libshibsp_lite_la-LogoutHandler.lo: handler/impl/LogoutHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-LogoutHandler.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-LogoutHandler.Tpo" -c -o libshibsp_lite_la-LogoutHandler.lo `test -f 'handler/impl/LogoutHandler.cpp' || echo '$(srcdir)/'`handler/impl/LogoutHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-LogoutHandler.Tpo" "$(DEPDIR)/libshibsp_lite_la-LogoutHandler.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-LogoutHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/LogoutHandler.cpp' object='libshibsp_lite_la-LogoutHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-LogoutHandler.lo `test -f 'handler/impl/LogoutHandler.cpp' || echo '$(srcdir)/'`handler/impl/LogoutHandler.cpp + +libshibsp_lite_la-MetadataGenerator.lo: handler/impl/MetadataGenerator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-MetadataGenerator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-MetadataGenerator.Tpo" -c -o libshibsp_lite_la-MetadataGenerator.lo `test -f 'handler/impl/MetadataGenerator.cpp' || echo '$(srcdir)/'`handler/impl/MetadataGenerator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-MetadataGenerator.Tpo" "$(DEPDIR)/libshibsp_lite_la-MetadataGenerator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-MetadataGenerator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/MetadataGenerator.cpp' object='libshibsp_lite_la-MetadataGenerator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-MetadataGenerator.lo `test -f 'handler/impl/MetadataGenerator.cpp' || echo '$(srcdir)/'`handler/impl/MetadataGenerator.cpp + +libshibsp_lite_la-RemotedHandler.lo: handler/impl/RemotedHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-RemotedHandler.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-RemotedHandler.Tpo" -c -o libshibsp_lite_la-RemotedHandler.lo `test -f 'handler/impl/RemotedHandler.cpp' || echo '$(srcdir)/'`handler/impl/RemotedHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-RemotedHandler.Tpo" "$(DEPDIR)/libshibsp_lite_la-RemotedHandler.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-RemotedHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/RemotedHandler.cpp' object='libshibsp_lite_la-RemotedHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-RemotedHandler.lo `test -f 'handler/impl/RemotedHandler.cpp' || echo '$(srcdir)/'`handler/impl/RemotedHandler.cpp + +libshibsp_lite_la-StatusHandler.lo: handler/impl/StatusHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-StatusHandler.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-StatusHandler.Tpo" -c -o libshibsp_lite_la-StatusHandler.lo `test -f 'handler/impl/StatusHandler.cpp' || echo '$(srcdir)/'`handler/impl/StatusHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-StatusHandler.Tpo" "$(DEPDIR)/libshibsp_lite_la-StatusHandler.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-StatusHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/StatusHandler.cpp' object='libshibsp_lite_la-StatusHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-StatusHandler.lo `test -f 'handler/impl/StatusHandler.cpp' || echo '$(srcdir)/'`handler/impl/StatusHandler.cpp + +libshibsp_lite_la-SessionHandler.lo: handler/impl/SessionHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SessionHandler.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SessionHandler.Tpo" -c -o libshibsp_lite_la-SessionHandler.lo `test -f 'handler/impl/SessionHandler.cpp' || echo '$(srcdir)/'`handler/impl/SessionHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SessionHandler.Tpo" "$(DEPDIR)/libshibsp_lite_la-SessionHandler.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SessionHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SessionHandler.cpp' object='libshibsp_lite_la-SessionHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SessionHandler.lo `test -f 'handler/impl/SessionHandler.cpp' || echo '$(srcdir)/'`handler/impl/SessionHandler.cpp + +libshibsp_lite_la-SAML1Consumer.lo: handler/impl/SAML1Consumer.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAML1Consumer.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAML1Consumer.Tpo" -c -o libshibsp_lite_la-SAML1Consumer.lo `test -f 'handler/impl/SAML1Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML1Consumer.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAML1Consumer.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAML1Consumer.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAML1Consumer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML1Consumer.cpp' object='libshibsp_lite_la-SAML1Consumer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAML1Consumer.lo `test -f 'handler/impl/SAML1Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML1Consumer.cpp + +libshibsp_lite_la-SAML2Consumer.lo: handler/impl/SAML2Consumer.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAML2Consumer.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAML2Consumer.Tpo" -c -o libshibsp_lite_la-SAML2Consumer.lo `test -f 'handler/impl/SAML2Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Consumer.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAML2Consumer.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAML2Consumer.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAML2Consumer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2Consumer.cpp' object='libshibsp_lite_la-SAML2Consumer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAML2Consumer.lo `test -f 'handler/impl/SAML2Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Consumer.cpp + +libshibsp_lite_la-SAML2ArtifactResolution.lo: handler/impl/SAML2ArtifactResolution.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAML2ArtifactResolution.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAML2ArtifactResolution.Tpo" -c -o libshibsp_lite_la-SAML2ArtifactResolution.lo `test -f 'handler/impl/SAML2ArtifactResolution.cpp' || echo '$(srcdir)/'`handler/impl/SAML2ArtifactResolution.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAML2ArtifactResolution.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAML2ArtifactResolution.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAML2ArtifactResolution.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2ArtifactResolution.cpp' object='libshibsp_lite_la-SAML2ArtifactResolution.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAML2ArtifactResolution.lo `test -f 'handler/impl/SAML2ArtifactResolution.cpp' || echo '$(srcdir)/'`handler/impl/SAML2ArtifactResolution.cpp + +libshibsp_lite_la-SAML2Logout.lo: handler/impl/SAML2Logout.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAML2Logout.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAML2Logout.Tpo" -c -o libshibsp_lite_la-SAML2Logout.lo `test -f 'handler/impl/SAML2Logout.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Logout.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAML2Logout.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAML2Logout.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAML2Logout.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2Logout.cpp' object='libshibsp_lite_la-SAML2Logout.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAML2Logout.lo `test -f 'handler/impl/SAML2Logout.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Logout.cpp + +libshibsp_lite_la-SAML2LogoutInitiator.lo: handler/impl/SAML2LogoutInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAML2LogoutInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAML2LogoutInitiator.Tpo" -c -o libshibsp_lite_la-SAML2LogoutInitiator.lo `test -f 'handler/impl/SAML2LogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2LogoutInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAML2LogoutInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAML2LogoutInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAML2LogoutInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2LogoutInitiator.cpp' object='libshibsp_lite_la-SAML2LogoutInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAML2LogoutInitiator.lo `test -f 'handler/impl/SAML2LogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2LogoutInitiator.cpp + +libshibsp_lite_la-SAML2NameIDMgmt.lo: handler/impl/SAML2NameIDMgmt.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAML2NameIDMgmt.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAML2NameIDMgmt.Tpo" -c -o libshibsp_lite_la-SAML2NameIDMgmt.lo `test -f 'handler/impl/SAML2NameIDMgmt.cpp' || echo '$(srcdir)/'`handler/impl/SAML2NameIDMgmt.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAML2NameIDMgmt.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAML2NameIDMgmt.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAML2NameIDMgmt.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2NameIDMgmt.cpp' object='libshibsp_lite_la-SAML2NameIDMgmt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAML2NameIDMgmt.lo `test -f 'handler/impl/SAML2NameIDMgmt.cpp' || echo '$(srcdir)/'`handler/impl/SAML2NameIDMgmt.cpp + +libshibsp_lite_la-SAML2SessionInitiator.lo: handler/impl/SAML2SessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAML2SessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAML2SessionInitiator.Tpo" -c -o libshibsp_lite_la-SAML2SessionInitiator.lo `test -f 'handler/impl/SAML2SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2SessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAML2SessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAML2SessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAML2SessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2SessionInitiator.cpp' object='libshibsp_lite_la-SAML2SessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAML2SessionInitiator.lo `test -f 'handler/impl/SAML2SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2SessionInitiator.cpp + +libshibsp_lite_la-SAMLDSSessionInitiator.lo: handler/impl/SAMLDSSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAMLDSSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAMLDSSessionInitiator.Tpo" -c -o libshibsp_lite_la-SAMLDSSessionInitiator.lo `test -f 'handler/impl/SAMLDSSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAMLDSSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAMLDSSessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAMLDSSessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAMLDSSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAMLDSSessionInitiator.cpp' object='libshibsp_lite_la-SAMLDSSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAMLDSSessionInitiator.lo `test -f 'handler/impl/SAMLDSSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAMLDSSessionInitiator.cpp + +libshibsp_lite_la-SessionInitiator.lo: handler/impl/SessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SessionInitiator.Tpo" -c -o libshibsp_lite_la-SessionInitiator.lo `test -f 'handler/impl/SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-SessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SessionInitiator.cpp' object='libshibsp_lite_la-SessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SessionInitiator.lo `test -f 'handler/impl/SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SessionInitiator.cpp + +libshibsp_lite_la-Shib1SessionInitiator.lo: handler/impl/Shib1SessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-Shib1SessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-Shib1SessionInitiator.Tpo" -c -o libshibsp_lite_la-Shib1SessionInitiator.lo `test -f 'handler/impl/Shib1SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/Shib1SessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-Shib1SessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-Shib1SessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-Shib1SessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/Shib1SessionInitiator.cpp' object='libshibsp_lite_la-Shib1SessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-Shib1SessionInitiator.lo `test -f 'handler/impl/Shib1SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/Shib1SessionInitiator.cpp + +libshibsp_lite_la-TransformSessionInitiator.lo: handler/impl/TransformSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-TransformSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-TransformSessionInitiator.Tpo" -c -o libshibsp_lite_la-TransformSessionInitiator.lo `test -f 'handler/impl/TransformSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/TransformSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-TransformSessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-TransformSessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-TransformSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/TransformSessionInitiator.cpp' object='libshibsp_lite_la-TransformSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-TransformSessionInitiator.lo `test -f 'handler/impl/TransformSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/TransformSessionInitiator.cpp + +libshibsp_lite_la-WAYFSessionInitiator.lo: handler/impl/WAYFSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-WAYFSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-WAYFSessionInitiator.Tpo" -c -o libshibsp_lite_la-WAYFSessionInitiator.lo `test -f 'handler/impl/WAYFSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/WAYFSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-WAYFSessionInitiator.Tpo" "$(DEPDIR)/libshibsp_lite_la-WAYFSessionInitiator.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-WAYFSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/WAYFSessionInitiator.cpp' object='libshibsp_lite_la-WAYFSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-WAYFSessionInitiator.lo `test -f 'handler/impl/WAYFSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/WAYFSessionInitiator.cpp + +libshibsp_lite_la-StorageServiceSessionCache.lo: impl/StorageServiceSessionCache.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-StorageServiceSessionCache.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-StorageServiceSessionCache.Tpo" -c -o libshibsp_lite_la-StorageServiceSessionCache.lo `test -f 'impl/StorageServiceSessionCache.cpp' || echo '$(srcdir)/'`impl/StorageServiceSessionCache.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-StorageServiceSessionCache.Tpo" "$(DEPDIR)/libshibsp_lite_la-StorageServiceSessionCache.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-StorageServiceSessionCache.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/StorageServiceSessionCache.cpp' object='libshibsp_lite_la-StorageServiceSessionCache.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-StorageServiceSessionCache.lo `test -f 'impl/StorageServiceSessionCache.cpp' || echo '$(srcdir)/'`impl/StorageServiceSessionCache.cpp + +libshibsp_lite_la-XMLAccessControl.lo: impl/XMLAccessControl.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-XMLAccessControl.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-XMLAccessControl.Tpo" -c -o libshibsp_lite_la-XMLAccessControl.lo `test -f 'impl/XMLAccessControl.cpp' || echo '$(srcdir)/'`impl/XMLAccessControl.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-XMLAccessControl.Tpo" "$(DEPDIR)/libshibsp_lite_la-XMLAccessControl.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-XMLAccessControl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/XMLAccessControl.cpp' object='libshibsp_lite_la-XMLAccessControl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-XMLAccessControl.lo `test -f 'impl/XMLAccessControl.cpp' || echo '$(srcdir)/'`impl/XMLAccessControl.cpp + +libshibsp_lite_la-XMLRequestMapper.lo: impl/XMLRequestMapper.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-XMLRequestMapper.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-XMLRequestMapper.Tpo" -c -o libshibsp_lite_la-XMLRequestMapper.lo `test -f 'impl/XMLRequestMapper.cpp' || echo '$(srcdir)/'`impl/XMLRequestMapper.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-XMLRequestMapper.Tpo" "$(DEPDIR)/libshibsp_lite_la-XMLRequestMapper.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-XMLRequestMapper.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/XMLRequestMapper.cpp' object='libshibsp_lite_la-XMLRequestMapper.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-XMLRequestMapper.lo `test -f 'impl/XMLRequestMapper.cpp' || echo '$(srcdir)/'`impl/XMLRequestMapper.cpp + +libshibsp_lite_la-XMLServiceProvider.lo: impl/XMLServiceProvider.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-XMLServiceProvider.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-XMLServiceProvider.Tpo" -c -o libshibsp_lite_la-XMLServiceProvider.lo `test -f 'impl/XMLServiceProvider.cpp' || echo '$(srcdir)/'`impl/XMLServiceProvider.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-XMLServiceProvider.Tpo" "$(DEPDIR)/libshibsp_lite_la-XMLServiceProvider.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-XMLServiceProvider.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/XMLServiceProvider.cpp' object='libshibsp_lite_la-XMLServiceProvider.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-XMLServiceProvider.lo `test -f 'impl/XMLServiceProvider.cpp' || echo '$(srcdir)/'`impl/XMLServiceProvider.cpp + +libshibsp_lite_la-ddf.lo: remoting/impl/ddf.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-ddf.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-ddf.Tpo" -c -o libshibsp_lite_la-ddf.lo `test -f 'remoting/impl/ddf.cpp' || echo '$(srcdir)/'`remoting/impl/ddf.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-ddf.Tpo" "$(DEPDIR)/libshibsp_lite_la-ddf.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-ddf.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/ddf.cpp' object='libshibsp_lite_la-ddf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-ddf.lo `test -f 'remoting/impl/ddf.cpp' || echo '$(srcdir)/'`remoting/impl/ddf.cpp + +libshibsp_lite_la-ListenerService.lo: remoting/impl/ListenerService.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-ListenerService.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-ListenerService.Tpo" -c -o libshibsp_lite_la-ListenerService.lo `test -f 'remoting/impl/ListenerService.cpp' || echo '$(srcdir)/'`remoting/impl/ListenerService.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-ListenerService.Tpo" "$(DEPDIR)/libshibsp_lite_la-ListenerService.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-ListenerService.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/ListenerService.cpp' object='libshibsp_lite_la-ListenerService.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-ListenerService.lo `test -f 'remoting/impl/ListenerService.cpp' || echo '$(srcdir)/'`remoting/impl/ListenerService.cpp + +libshibsp_lite_la-SocketListener.lo: remoting/impl/SocketListener.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SocketListener.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SocketListener.Tpo" -c -o libshibsp_lite_la-SocketListener.lo `test -f 'remoting/impl/SocketListener.cpp' || echo '$(srcdir)/'`remoting/impl/SocketListener.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SocketListener.Tpo" "$(DEPDIR)/libshibsp_lite_la-SocketListener.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SocketListener.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/SocketListener.cpp' object='libshibsp_lite_la-SocketListener.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SocketListener.lo `test -f 'remoting/impl/SocketListener.cpp' || echo '$(srcdir)/'`remoting/impl/SocketListener.cpp + +libshibsp_lite_la-TCPListener.lo: remoting/impl/TCPListener.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-TCPListener.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-TCPListener.Tpo" -c -o libshibsp_lite_la-TCPListener.lo `test -f 'remoting/impl/TCPListener.cpp' || echo '$(srcdir)/'`remoting/impl/TCPListener.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-TCPListener.Tpo" "$(DEPDIR)/libshibsp_lite_la-TCPListener.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-TCPListener.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/TCPListener.cpp' object='libshibsp_lite_la-TCPListener.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-TCPListener.lo `test -f 'remoting/impl/TCPListener.cpp' || echo '$(srcdir)/'`remoting/impl/TCPListener.cpp + +libshibsp_lite_la-UnixListener.lo: remoting/impl/UnixListener.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-UnixListener.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-UnixListener.Tpo" -c -o libshibsp_lite_la-UnixListener.lo `test -f 'remoting/impl/UnixListener.cpp' || echo '$(srcdir)/'`remoting/impl/UnixListener.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-UnixListener.Tpo" "$(DEPDIR)/libshibsp_lite_la-UnixListener.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-UnixListener.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/UnixListener.cpp' object='libshibsp_lite_la-UnixListener.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-UnixListener.lo `test -f 'remoting/impl/UnixListener.cpp' || echo '$(srcdir)/'`remoting/impl/UnixListener.cpp + +libshibsp_lite_la-CGIParser.lo: util/CGIParser.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-CGIParser.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-CGIParser.Tpo" -c -o libshibsp_lite_la-CGIParser.lo `test -f 'util/CGIParser.cpp' || echo '$(srcdir)/'`util/CGIParser.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-CGIParser.Tpo" "$(DEPDIR)/libshibsp_lite_la-CGIParser.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-CGIParser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/CGIParser.cpp' object='libshibsp_lite_la-CGIParser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-CGIParser.lo `test -f 'util/CGIParser.cpp' || echo '$(srcdir)/'`util/CGIParser.cpp + +libshibsp_lite_la-DOMPropertySet.lo: util/DOMPropertySet.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-DOMPropertySet.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-DOMPropertySet.Tpo" -c -o libshibsp_lite_la-DOMPropertySet.lo `test -f 'util/DOMPropertySet.cpp' || echo '$(srcdir)/'`util/DOMPropertySet.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-DOMPropertySet.Tpo" "$(DEPDIR)/libshibsp_lite_la-DOMPropertySet.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-DOMPropertySet.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/DOMPropertySet.cpp' object='libshibsp_lite_la-DOMPropertySet.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-DOMPropertySet.lo `test -f 'util/DOMPropertySet.cpp' || echo '$(srcdir)/'`util/DOMPropertySet.cpp + +libshibsp_lite_la-SPConstants.lo: util/SPConstants.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SPConstants.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SPConstants.Tpo" -c -o libshibsp_lite_la-SPConstants.lo `test -f 'util/SPConstants.cpp' || echo '$(srcdir)/'`util/SPConstants.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SPConstants.Tpo" "$(DEPDIR)/libshibsp_lite_la-SPConstants.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SPConstants.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/SPConstants.cpp' object='libshibsp_lite_la-SPConstants.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SPConstants.lo `test -f 'util/SPConstants.cpp' || echo '$(srcdir)/'`util/SPConstants.cpp + +libshibsp_lite_la-TemplateParameters.lo: util/TemplateParameters.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-TemplateParameters.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-TemplateParameters.Tpo" -c -o libshibsp_lite_la-TemplateParameters.lo `test -f 'util/TemplateParameters.cpp' || echo '$(srcdir)/'`util/TemplateParameters.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-TemplateParameters.Tpo" "$(DEPDIR)/libshibsp_lite_la-TemplateParameters.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-TemplateParameters.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/TemplateParameters.cpp' object='libshibsp_lite_la-TemplateParameters.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-TemplateParameters.lo `test -f 'util/TemplateParameters.cpp' || echo '$(srcdir)/'`util/TemplateParameters.cpp + +libshibsp_lite_la-CommonDomainCookie.lo: lite/CommonDomainCookie.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-CommonDomainCookie.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-CommonDomainCookie.Tpo" -c -o libshibsp_lite_la-CommonDomainCookie.lo `test -f 'lite/CommonDomainCookie.cpp' || echo '$(srcdir)/'`lite/CommonDomainCookie.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-CommonDomainCookie.Tpo" "$(DEPDIR)/libshibsp_lite_la-CommonDomainCookie.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-CommonDomainCookie.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lite/CommonDomainCookie.cpp' object='libshibsp_lite_la-CommonDomainCookie.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-CommonDomainCookie.lo `test -f 'lite/CommonDomainCookie.cpp' || echo '$(srcdir)/'`lite/CommonDomainCookie.cpp + +libshibsp_lite_la-SAMLConstants.lo: lite/SAMLConstants.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libshibsp_lite_la-SAMLConstants.lo -MD -MP -MF "$(DEPDIR)/libshibsp_lite_la-SAMLConstants.Tpo" -c -o libshibsp_lite_la-SAMLConstants.lo `test -f 'lite/SAMLConstants.cpp' || echo '$(srcdir)/'`lite/SAMLConstants.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libshibsp_lite_la-SAMLConstants.Tpo" "$(DEPDIR)/libshibsp_lite_la-SAMLConstants.Plo"; else rm -f "$(DEPDIR)/libshibsp_lite_la-SAMLConstants.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lite/SAMLConstants.cpp' object='libshibsp_lite_la-SAMLConstants.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libshibsp_lite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libshibsp_lite_la-SAMLConstants.lo `test -f 'lite/SAMLConstants.cpp' || echo '$(srcdir)/'`lite/SAMLConstants.cpp + +Attribute.lo: attribute/Attribute.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Attribute.lo -MD -MP -MF "$(DEPDIR)/Attribute.Tpo" -c -o Attribute.lo `test -f 'attribute/Attribute.cpp' || echo '$(srcdir)/'`attribute/Attribute.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Attribute.Tpo" "$(DEPDIR)/Attribute.Plo"; else rm -f "$(DEPDIR)/Attribute.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/Attribute.cpp' object='Attribute.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Attribute.lo `test -f 'attribute/Attribute.cpp' || echo '$(srcdir)/'`attribute/Attribute.cpp + +AbstractHandler.lo: handler/impl/AbstractHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AbstractHandler.lo -MD -MP -MF "$(DEPDIR)/AbstractHandler.Tpo" -c -o AbstractHandler.lo `test -f 'handler/impl/AbstractHandler.cpp' || echo '$(srcdir)/'`handler/impl/AbstractHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AbstractHandler.Tpo" "$(DEPDIR)/AbstractHandler.Plo"; else rm -f "$(DEPDIR)/AbstractHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/AbstractHandler.cpp' object='AbstractHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AbstractHandler.lo `test -f 'handler/impl/AbstractHandler.cpp' || echo '$(srcdir)/'`handler/impl/AbstractHandler.cpp + +AssertionConsumerService.lo: handler/impl/AssertionConsumerService.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AssertionConsumerService.lo -MD -MP -MF "$(DEPDIR)/AssertionConsumerService.Tpo" -c -o AssertionConsumerService.lo `test -f 'handler/impl/AssertionConsumerService.cpp' || echo '$(srcdir)/'`handler/impl/AssertionConsumerService.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AssertionConsumerService.Tpo" "$(DEPDIR)/AssertionConsumerService.Plo"; else rm -f "$(DEPDIR)/AssertionConsumerService.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/AssertionConsumerService.cpp' object='AssertionConsumerService.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AssertionConsumerService.lo `test -f 'handler/impl/AssertionConsumerService.cpp' || echo '$(srcdir)/'`handler/impl/AssertionConsumerService.cpp + +AssertionLookup.lo: handler/impl/AssertionLookup.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AssertionLookup.lo -MD -MP -MF "$(DEPDIR)/AssertionLookup.Tpo" -c -o AssertionLookup.lo `test -f 'handler/impl/AssertionLookup.cpp' || echo '$(srcdir)/'`handler/impl/AssertionLookup.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AssertionLookup.Tpo" "$(DEPDIR)/AssertionLookup.Plo"; else rm -f "$(DEPDIR)/AssertionLookup.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/AssertionLookup.cpp' object='AssertionLookup.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AssertionLookup.lo `test -f 'handler/impl/AssertionLookup.cpp' || echo '$(srcdir)/'`handler/impl/AssertionLookup.cpp + +ChainingLogoutInitiator.lo: handler/impl/ChainingLogoutInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ChainingLogoutInitiator.lo -MD -MP -MF "$(DEPDIR)/ChainingLogoutInitiator.Tpo" -c -o ChainingLogoutInitiator.lo `test -f 'handler/impl/ChainingLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingLogoutInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ChainingLogoutInitiator.Tpo" "$(DEPDIR)/ChainingLogoutInitiator.Plo"; else rm -f "$(DEPDIR)/ChainingLogoutInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/ChainingLogoutInitiator.cpp' object='ChainingLogoutInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ChainingLogoutInitiator.lo `test -f 'handler/impl/ChainingLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingLogoutInitiator.cpp + +ChainingSessionInitiator.lo: handler/impl/ChainingSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ChainingSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/ChainingSessionInitiator.Tpo" -c -o ChainingSessionInitiator.lo `test -f 'handler/impl/ChainingSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ChainingSessionInitiator.Tpo" "$(DEPDIR)/ChainingSessionInitiator.Plo"; else rm -f "$(DEPDIR)/ChainingSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/ChainingSessionInitiator.cpp' object='ChainingSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ChainingSessionInitiator.lo `test -f 'handler/impl/ChainingSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/ChainingSessionInitiator.cpp + +CookieSessionInitiator.lo: handler/impl/CookieSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CookieSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/CookieSessionInitiator.Tpo" -c -o CookieSessionInitiator.lo `test -f 'handler/impl/CookieSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/CookieSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/CookieSessionInitiator.Tpo" "$(DEPDIR)/CookieSessionInitiator.Plo"; else rm -f "$(DEPDIR)/CookieSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/CookieSessionInitiator.cpp' object='CookieSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CookieSessionInitiator.lo `test -f 'handler/impl/CookieSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/CookieSessionInitiator.cpp + +FormSessionInitiator.lo: handler/impl/FormSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FormSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/FormSessionInitiator.Tpo" -c -o FormSessionInitiator.lo `test -f 'handler/impl/FormSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/FormSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/FormSessionInitiator.Tpo" "$(DEPDIR)/FormSessionInitiator.Plo"; else rm -f "$(DEPDIR)/FormSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/FormSessionInitiator.cpp' object='FormSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FormSessionInitiator.lo `test -f 'handler/impl/FormSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/FormSessionInitiator.cpp + +LocalLogoutInitiator.lo: handler/impl/LocalLogoutInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LocalLogoutInitiator.lo -MD -MP -MF "$(DEPDIR)/LocalLogoutInitiator.Tpo" -c -o LocalLogoutInitiator.lo `test -f 'handler/impl/LocalLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/LocalLogoutInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/LocalLogoutInitiator.Tpo" "$(DEPDIR)/LocalLogoutInitiator.Plo"; else rm -f "$(DEPDIR)/LocalLogoutInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/LocalLogoutInitiator.cpp' object='LocalLogoutInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LocalLogoutInitiator.lo `test -f 'handler/impl/LocalLogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/LocalLogoutInitiator.cpp + +LogoutHandler.lo: handler/impl/LogoutHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LogoutHandler.lo -MD -MP -MF "$(DEPDIR)/LogoutHandler.Tpo" -c -o LogoutHandler.lo `test -f 'handler/impl/LogoutHandler.cpp' || echo '$(srcdir)/'`handler/impl/LogoutHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/LogoutHandler.Tpo" "$(DEPDIR)/LogoutHandler.Plo"; else rm -f "$(DEPDIR)/LogoutHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/LogoutHandler.cpp' object='LogoutHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LogoutHandler.lo `test -f 'handler/impl/LogoutHandler.cpp' || echo '$(srcdir)/'`handler/impl/LogoutHandler.cpp + +MetadataGenerator.lo: handler/impl/MetadataGenerator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MetadataGenerator.lo -MD -MP -MF "$(DEPDIR)/MetadataGenerator.Tpo" -c -o MetadataGenerator.lo `test -f 'handler/impl/MetadataGenerator.cpp' || echo '$(srcdir)/'`handler/impl/MetadataGenerator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/MetadataGenerator.Tpo" "$(DEPDIR)/MetadataGenerator.Plo"; else rm -f "$(DEPDIR)/MetadataGenerator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/MetadataGenerator.cpp' object='MetadataGenerator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MetadataGenerator.lo `test -f 'handler/impl/MetadataGenerator.cpp' || echo '$(srcdir)/'`handler/impl/MetadataGenerator.cpp + +RemotedHandler.lo: handler/impl/RemotedHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RemotedHandler.lo -MD -MP -MF "$(DEPDIR)/RemotedHandler.Tpo" -c -o RemotedHandler.lo `test -f 'handler/impl/RemotedHandler.cpp' || echo '$(srcdir)/'`handler/impl/RemotedHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/RemotedHandler.Tpo" "$(DEPDIR)/RemotedHandler.Plo"; else rm -f "$(DEPDIR)/RemotedHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/RemotedHandler.cpp' object='RemotedHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RemotedHandler.lo `test -f 'handler/impl/RemotedHandler.cpp' || echo '$(srcdir)/'`handler/impl/RemotedHandler.cpp + +StatusHandler.lo: handler/impl/StatusHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT StatusHandler.lo -MD -MP -MF "$(DEPDIR)/StatusHandler.Tpo" -c -o StatusHandler.lo `test -f 'handler/impl/StatusHandler.cpp' || echo '$(srcdir)/'`handler/impl/StatusHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/StatusHandler.Tpo" "$(DEPDIR)/StatusHandler.Plo"; else rm -f "$(DEPDIR)/StatusHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/StatusHandler.cpp' object='StatusHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o StatusHandler.lo `test -f 'handler/impl/StatusHandler.cpp' || echo '$(srcdir)/'`handler/impl/StatusHandler.cpp + +SessionHandler.lo: handler/impl/SessionHandler.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SessionHandler.lo -MD -MP -MF "$(DEPDIR)/SessionHandler.Tpo" -c -o SessionHandler.lo `test -f 'handler/impl/SessionHandler.cpp' || echo '$(srcdir)/'`handler/impl/SessionHandler.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SessionHandler.Tpo" "$(DEPDIR)/SessionHandler.Plo"; else rm -f "$(DEPDIR)/SessionHandler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SessionHandler.cpp' object='SessionHandler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SessionHandler.lo `test -f 'handler/impl/SessionHandler.cpp' || echo '$(srcdir)/'`handler/impl/SessionHandler.cpp + +SAML1Consumer.lo: handler/impl/SAML1Consumer.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAML1Consumer.lo -MD -MP -MF "$(DEPDIR)/SAML1Consumer.Tpo" -c -o SAML1Consumer.lo `test -f 'handler/impl/SAML1Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML1Consumer.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAML1Consumer.Tpo" "$(DEPDIR)/SAML1Consumer.Plo"; else rm -f "$(DEPDIR)/SAML1Consumer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML1Consumer.cpp' object='SAML1Consumer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAML1Consumer.lo `test -f 'handler/impl/SAML1Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML1Consumer.cpp + +SAML2Consumer.lo: handler/impl/SAML2Consumer.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAML2Consumer.lo -MD -MP -MF "$(DEPDIR)/SAML2Consumer.Tpo" -c -o SAML2Consumer.lo `test -f 'handler/impl/SAML2Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Consumer.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAML2Consumer.Tpo" "$(DEPDIR)/SAML2Consumer.Plo"; else rm -f "$(DEPDIR)/SAML2Consumer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2Consumer.cpp' object='SAML2Consumer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAML2Consumer.lo `test -f 'handler/impl/SAML2Consumer.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Consumer.cpp + +SAML2ArtifactResolution.lo: handler/impl/SAML2ArtifactResolution.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAML2ArtifactResolution.lo -MD -MP -MF "$(DEPDIR)/SAML2ArtifactResolution.Tpo" -c -o SAML2ArtifactResolution.lo `test -f 'handler/impl/SAML2ArtifactResolution.cpp' || echo '$(srcdir)/'`handler/impl/SAML2ArtifactResolution.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAML2ArtifactResolution.Tpo" "$(DEPDIR)/SAML2ArtifactResolution.Plo"; else rm -f "$(DEPDIR)/SAML2ArtifactResolution.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2ArtifactResolution.cpp' object='SAML2ArtifactResolution.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAML2ArtifactResolution.lo `test -f 'handler/impl/SAML2ArtifactResolution.cpp' || echo '$(srcdir)/'`handler/impl/SAML2ArtifactResolution.cpp + +SAML2Logout.lo: handler/impl/SAML2Logout.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAML2Logout.lo -MD -MP -MF "$(DEPDIR)/SAML2Logout.Tpo" -c -o SAML2Logout.lo `test -f 'handler/impl/SAML2Logout.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Logout.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAML2Logout.Tpo" "$(DEPDIR)/SAML2Logout.Plo"; else rm -f "$(DEPDIR)/SAML2Logout.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2Logout.cpp' object='SAML2Logout.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAML2Logout.lo `test -f 'handler/impl/SAML2Logout.cpp' || echo '$(srcdir)/'`handler/impl/SAML2Logout.cpp + +SAML2LogoutInitiator.lo: handler/impl/SAML2LogoutInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAML2LogoutInitiator.lo -MD -MP -MF "$(DEPDIR)/SAML2LogoutInitiator.Tpo" -c -o SAML2LogoutInitiator.lo `test -f 'handler/impl/SAML2LogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2LogoutInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAML2LogoutInitiator.Tpo" "$(DEPDIR)/SAML2LogoutInitiator.Plo"; else rm -f "$(DEPDIR)/SAML2LogoutInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2LogoutInitiator.cpp' object='SAML2LogoutInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAML2LogoutInitiator.lo `test -f 'handler/impl/SAML2LogoutInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2LogoutInitiator.cpp + +SAML2NameIDMgmt.lo: handler/impl/SAML2NameIDMgmt.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAML2NameIDMgmt.lo -MD -MP -MF "$(DEPDIR)/SAML2NameIDMgmt.Tpo" -c -o SAML2NameIDMgmt.lo `test -f 'handler/impl/SAML2NameIDMgmt.cpp' || echo '$(srcdir)/'`handler/impl/SAML2NameIDMgmt.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAML2NameIDMgmt.Tpo" "$(DEPDIR)/SAML2NameIDMgmt.Plo"; else rm -f "$(DEPDIR)/SAML2NameIDMgmt.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2NameIDMgmt.cpp' object='SAML2NameIDMgmt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAML2NameIDMgmt.lo `test -f 'handler/impl/SAML2NameIDMgmt.cpp' || echo '$(srcdir)/'`handler/impl/SAML2NameIDMgmt.cpp + +SAML2SessionInitiator.lo: handler/impl/SAML2SessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAML2SessionInitiator.lo -MD -MP -MF "$(DEPDIR)/SAML2SessionInitiator.Tpo" -c -o SAML2SessionInitiator.lo `test -f 'handler/impl/SAML2SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2SessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAML2SessionInitiator.Tpo" "$(DEPDIR)/SAML2SessionInitiator.Plo"; else rm -f "$(DEPDIR)/SAML2SessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAML2SessionInitiator.cpp' object='SAML2SessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAML2SessionInitiator.lo `test -f 'handler/impl/SAML2SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAML2SessionInitiator.cpp + +SAMLDSSessionInitiator.lo: handler/impl/SAMLDSSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SAMLDSSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/SAMLDSSessionInitiator.Tpo" -c -o SAMLDSSessionInitiator.lo `test -f 'handler/impl/SAMLDSSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAMLDSSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SAMLDSSessionInitiator.Tpo" "$(DEPDIR)/SAMLDSSessionInitiator.Plo"; else rm -f "$(DEPDIR)/SAMLDSSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SAMLDSSessionInitiator.cpp' object='SAMLDSSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SAMLDSSessionInitiator.lo `test -f 'handler/impl/SAMLDSSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SAMLDSSessionInitiator.cpp + +SessionInitiator.lo: handler/impl/SessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SessionInitiator.lo -MD -MP -MF "$(DEPDIR)/SessionInitiator.Tpo" -c -o SessionInitiator.lo `test -f 'handler/impl/SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SessionInitiator.Tpo" "$(DEPDIR)/SessionInitiator.Plo"; else rm -f "$(DEPDIR)/SessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/SessionInitiator.cpp' object='SessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SessionInitiator.lo `test -f 'handler/impl/SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/SessionInitiator.cpp + +Shib1SessionInitiator.lo: handler/impl/Shib1SessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Shib1SessionInitiator.lo -MD -MP -MF "$(DEPDIR)/Shib1SessionInitiator.Tpo" -c -o Shib1SessionInitiator.lo `test -f 'handler/impl/Shib1SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/Shib1SessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Shib1SessionInitiator.Tpo" "$(DEPDIR)/Shib1SessionInitiator.Plo"; else rm -f "$(DEPDIR)/Shib1SessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/Shib1SessionInitiator.cpp' object='Shib1SessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Shib1SessionInitiator.lo `test -f 'handler/impl/Shib1SessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/Shib1SessionInitiator.cpp + +TransformSessionInitiator.lo: handler/impl/TransformSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TransformSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/TransformSessionInitiator.Tpo" -c -o TransformSessionInitiator.lo `test -f 'handler/impl/TransformSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/TransformSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/TransformSessionInitiator.Tpo" "$(DEPDIR)/TransformSessionInitiator.Plo"; else rm -f "$(DEPDIR)/TransformSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/TransformSessionInitiator.cpp' object='TransformSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TransformSessionInitiator.lo `test -f 'handler/impl/TransformSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/TransformSessionInitiator.cpp + +WAYFSessionInitiator.lo: handler/impl/WAYFSessionInitiator.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT WAYFSessionInitiator.lo -MD -MP -MF "$(DEPDIR)/WAYFSessionInitiator.Tpo" -c -o WAYFSessionInitiator.lo `test -f 'handler/impl/WAYFSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/WAYFSessionInitiator.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/WAYFSessionInitiator.Tpo" "$(DEPDIR)/WAYFSessionInitiator.Plo"; else rm -f "$(DEPDIR)/WAYFSessionInitiator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='handler/impl/WAYFSessionInitiator.cpp' object='WAYFSessionInitiator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o WAYFSessionInitiator.lo `test -f 'handler/impl/WAYFSessionInitiator.cpp' || echo '$(srcdir)/'`handler/impl/WAYFSessionInitiator.cpp + +StorageServiceSessionCache.lo: impl/StorageServiceSessionCache.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT StorageServiceSessionCache.lo -MD -MP -MF "$(DEPDIR)/StorageServiceSessionCache.Tpo" -c -o StorageServiceSessionCache.lo `test -f 'impl/StorageServiceSessionCache.cpp' || echo '$(srcdir)/'`impl/StorageServiceSessionCache.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/StorageServiceSessionCache.Tpo" "$(DEPDIR)/StorageServiceSessionCache.Plo"; else rm -f "$(DEPDIR)/StorageServiceSessionCache.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/StorageServiceSessionCache.cpp' object='StorageServiceSessionCache.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o StorageServiceSessionCache.lo `test -f 'impl/StorageServiceSessionCache.cpp' || echo '$(srcdir)/'`impl/StorageServiceSessionCache.cpp + +XMLAccessControl.lo: impl/XMLAccessControl.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XMLAccessControl.lo -MD -MP -MF "$(DEPDIR)/XMLAccessControl.Tpo" -c -o XMLAccessControl.lo `test -f 'impl/XMLAccessControl.cpp' || echo '$(srcdir)/'`impl/XMLAccessControl.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/XMLAccessControl.Tpo" "$(DEPDIR)/XMLAccessControl.Plo"; else rm -f "$(DEPDIR)/XMLAccessControl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/XMLAccessControl.cpp' object='XMLAccessControl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XMLAccessControl.lo `test -f 'impl/XMLAccessControl.cpp' || echo '$(srcdir)/'`impl/XMLAccessControl.cpp + +XMLRequestMapper.lo: impl/XMLRequestMapper.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XMLRequestMapper.lo -MD -MP -MF "$(DEPDIR)/XMLRequestMapper.Tpo" -c -o XMLRequestMapper.lo `test -f 'impl/XMLRequestMapper.cpp' || echo '$(srcdir)/'`impl/XMLRequestMapper.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/XMLRequestMapper.Tpo" "$(DEPDIR)/XMLRequestMapper.Plo"; else rm -f "$(DEPDIR)/XMLRequestMapper.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/XMLRequestMapper.cpp' object='XMLRequestMapper.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XMLRequestMapper.lo `test -f 'impl/XMLRequestMapper.cpp' || echo '$(srcdir)/'`impl/XMLRequestMapper.cpp + +XMLServiceProvider.lo: impl/XMLServiceProvider.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XMLServiceProvider.lo -MD -MP -MF "$(DEPDIR)/XMLServiceProvider.Tpo" -c -o XMLServiceProvider.lo `test -f 'impl/XMLServiceProvider.cpp' || echo '$(srcdir)/'`impl/XMLServiceProvider.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/XMLServiceProvider.Tpo" "$(DEPDIR)/XMLServiceProvider.Plo"; else rm -f "$(DEPDIR)/XMLServiceProvider.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='impl/XMLServiceProvider.cpp' object='XMLServiceProvider.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XMLServiceProvider.lo `test -f 'impl/XMLServiceProvider.cpp' || echo '$(srcdir)/'`impl/XMLServiceProvider.cpp + +ddf.lo: remoting/impl/ddf.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ddf.lo -MD -MP -MF "$(DEPDIR)/ddf.Tpo" -c -o ddf.lo `test -f 'remoting/impl/ddf.cpp' || echo '$(srcdir)/'`remoting/impl/ddf.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ddf.Tpo" "$(DEPDIR)/ddf.Plo"; else rm -f "$(DEPDIR)/ddf.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/ddf.cpp' object='ddf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ddf.lo `test -f 'remoting/impl/ddf.cpp' || echo '$(srcdir)/'`remoting/impl/ddf.cpp + +ListenerService.lo: remoting/impl/ListenerService.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ListenerService.lo -MD -MP -MF "$(DEPDIR)/ListenerService.Tpo" -c -o ListenerService.lo `test -f 'remoting/impl/ListenerService.cpp' || echo '$(srcdir)/'`remoting/impl/ListenerService.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ListenerService.Tpo" "$(DEPDIR)/ListenerService.Plo"; else rm -f "$(DEPDIR)/ListenerService.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/ListenerService.cpp' object='ListenerService.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ListenerService.lo `test -f 'remoting/impl/ListenerService.cpp' || echo '$(srcdir)/'`remoting/impl/ListenerService.cpp + +SocketListener.lo: remoting/impl/SocketListener.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SocketListener.lo -MD -MP -MF "$(DEPDIR)/SocketListener.Tpo" -c -o SocketListener.lo `test -f 'remoting/impl/SocketListener.cpp' || echo '$(srcdir)/'`remoting/impl/SocketListener.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SocketListener.Tpo" "$(DEPDIR)/SocketListener.Plo"; else rm -f "$(DEPDIR)/SocketListener.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/SocketListener.cpp' object='SocketListener.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SocketListener.lo `test -f 'remoting/impl/SocketListener.cpp' || echo '$(srcdir)/'`remoting/impl/SocketListener.cpp + +TCPListener.lo: remoting/impl/TCPListener.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TCPListener.lo -MD -MP -MF "$(DEPDIR)/TCPListener.Tpo" -c -o TCPListener.lo `test -f 'remoting/impl/TCPListener.cpp' || echo '$(srcdir)/'`remoting/impl/TCPListener.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/TCPListener.Tpo" "$(DEPDIR)/TCPListener.Plo"; else rm -f "$(DEPDIR)/TCPListener.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/TCPListener.cpp' object='TCPListener.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TCPListener.lo `test -f 'remoting/impl/TCPListener.cpp' || echo '$(srcdir)/'`remoting/impl/TCPListener.cpp + +UnixListener.lo: remoting/impl/UnixListener.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UnixListener.lo -MD -MP -MF "$(DEPDIR)/UnixListener.Tpo" -c -o UnixListener.lo `test -f 'remoting/impl/UnixListener.cpp' || echo '$(srcdir)/'`remoting/impl/UnixListener.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/UnixListener.Tpo" "$(DEPDIR)/UnixListener.Plo"; else rm -f "$(DEPDIR)/UnixListener.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='remoting/impl/UnixListener.cpp' object='UnixListener.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UnixListener.lo `test -f 'remoting/impl/UnixListener.cpp' || echo '$(srcdir)/'`remoting/impl/UnixListener.cpp + +CGIParser.lo: util/CGIParser.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CGIParser.lo -MD -MP -MF "$(DEPDIR)/CGIParser.Tpo" -c -o CGIParser.lo `test -f 'util/CGIParser.cpp' || echo '$(srcdir)/'`util/CGIParser.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/CGIParser.Tpo" "$(DEPDIR)/CGIParser.Plo"; else rm -f "$(DEPDIR)/CGIParser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/CGIParser.cpp' object='CGIParser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CGIParser.lo `test -f 'util/CGIParser.cpp' || echo '$(srcdir)/'`util/CGIParser.cpp + +DOMPropertySet.lo: util/DOMPropertySet.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DOMPropertySet.lo -MD -MP -MF "$(DEPDIR)/DOMPropertySet.Tpo" -c -o DOMPropertySet.lo `test -f 'util/DOMPropertySet.cpp' || echo '$(srcdir)/'`util/DOMPropertySet.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/DOMPropertySet.Tpo" "$(DEPDIR)/DOMPropertySet.Plo"; else rm -f "$(DEPDIR)/DOMPropertySet.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/DOMPropertySet.cpp' object='DOMPropertySet.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DOMPropertySet.lo `test -f 'util/DOMPropertySet.cpp' || echo '$(srcdir)/'`util/DOMPropertySet.cpp + +SPConstants.lo: util/SPConstants.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SPConstants.lo -MD -MP -MF "$(DEPDIR)/SPConstants.Tpo" -c -o SPConstants.lo `test -f 'util/SPConstants.cpp' || echo '$(srcdir)/'`util/SPConstants.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SPConstants.Tpo" "$(DEPDIR)/SPConstants.Plo"; else rm -f "$(DEPDIR)/SPConstants.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/SPConstants.cpp' object='SPConstants.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SPConstants.lo `test -f 'util/SPConstants.cpp' || echo '$(srcdir)/'`util/SPConstants.cpp + +TemplateParameters.lo: util/TemplateParameters.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TemplateParameters.lo -MD -MP -MF "$(DEPDIR)/TemplateParameters.Tpo" -c -o TemplateParameters.lo `test -f 'util/TemplateParameters.cpp' || echo '$(srcdir)/'`util/TemplateParameters.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/TemplateParameters.Tpo" "$(DEPDIR)/TemplateParameters.Plo"; else rm -f "$(DEPDIR)/TemplateParameters.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/TemplateParameters.cpp' object='TemplateParameters.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TemplateParameters.lo `test -f 'util/TemplateParameters.cpp' || echo '$(srcdir)/'`util/TemplateParameters.cpp + +NameIDAttributeDecoder.lo: attribute/NameIDAttributeDecoder.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NameIDAttributeDecoder.lo -MD -MP -MF "$(DEPDIR)/NameIDAttributeDecoder.Tpo" -c -o NameIDAttributeDecoder.lo `test -f 'attribute/NameIDAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/NameIDAttributeDecoder.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/NameIDAttributeDecoder.Tpo" "$(DEPDIR)/NameIDAttributeDecoder.Plo"; else rm -f "$(DEPDIR)/NameIDAttributeDecoder.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/NameIDAttributeDecoder.cpp' object='NameIDAttributeDecoder.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NameIDAttributeDecoder.lo `test -f 'attribute/NameIDAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/NameIDAttributeDecoder.cpp + +ScopedAttributeDecoder.lo: attribute/ScopedAttributeDecoder.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ScopedAttributeDecoder.lo -MD -MP -MF "$(DEPDIR)/ScopedAttributeDecoder.Tpo" -c -o ScopedAttributeDecoder.lo `test -f 'attribute/ScopedAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/ScopedAttributeDecoder.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ScopedAttributeDecoder.Tpo" "$(DEPDIR)/ScopedAttributeDecoder.Plo"; else rm -f "$(DEPDIR)/ScopedAttributeDecoder.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/ScopedAttributeDecoder.cpp' object='ScopedAttributeDecoder.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ScopedAttributeDecoder.lo `test -f 'attribute/ScopedAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/ScopedAttributeDecoder.cpp + +StringAttributeDecoder.lo: attribute/StringAttributeDecoder.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT StringAttributeDecoder.lo -MD -MP -MF "$(DEPDIR)/StringAttributeDecoder.Tpo" -c -o StringAttributeDecoder.lo `test -f 'attribute/StringAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/StringAttributeDecoder.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/StringAttributeDecoder.Tpo" "$(DEPDIR)/StringAttributeDecoder.Plo"; else rm -f "$(DEPDIR)/StringAttributeDecoder.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/StringAttributeDecoder.cpp' object='StringAttributeDecoder.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o StringAttributeDecoder.lo `test -f 'attribute/StringAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/StringAttributeDecoder.cpp + +AttributeFilter.lo: attribute/filtering/impl/AttributeFilter.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeFilter.lo -MD -MP -MF "$(DEPDIR)/AttributeFilter.Tpo" -c -o AttributeFilter.lo `test -f 'attribute/filtering/impl/AttributeFilter.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeFilter.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeFilter.Tpo" "$(DEPDIR)/AttributeFilter.Plo"; else rm -f "$(DEPDIR)/AttributeFilter.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeFilter.cpp' object='AttributeFilter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeFilter.lo `test -f 'attribute/filtering/impl/AttributeFilter.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeFilter.cpp + +ChainingAttributeFilter.lo: attribute/filtering/impl/ChainingAttributeFilter.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ChainingAttributeFilter.lo -MD -MP -MF "$(DEPDIR)/ChainingAttributeFilter.Tpo" -c -o ChainingAttributeFilter.lo `test -f 'attribute/filtering/impl/ChainingAttributeFilter.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/ChainingAttributeFilter.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ChainingAttributeFilter.Tpo" "$(DEPDIR)/ChainingAttributeFilter.Plo"; else rm -f "$(DEPDIR)/ChainingAttributeFilter.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/ChainingAttributeFilter.cpp' object='ChainingAttributeFilter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ChainingAttributeFilter.lo `test -f 'attribute/filtering/impl/ChainingAttributeFilter.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/ChainingAttributeFilter.cpp + +XMLAttributeFilter.lo: attribute/filtering/impl/XMLAttributeFilter.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XMLAttributeFilter.lo -MD -MP -MF "$(DEPDIR)/XMLAttributeFilter.Tpo" -c -o XMLAttributeFilter.lo `test -f 'attribute/filtering/impl/XMLAttributeFilter.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/XMLAttributeFilter.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/XMLAttributeFilter.Tpo" "$(DEPDIR)/XMLAttributeFilter.Plo"; else rm -f "$(DEPDIR)/XMLAttributeFilter.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/XMLAttributeFilter.cpp' object='XMLAttributeFilter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XMLAttributeFilter.lo `test -f 'attribute/filtering/impl/XMLAttributeFilter.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/XMLAttributeFilter.cpp + +MatchFunctor.lo: attribute/filtering/impl/MatchFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MatchFunctor.lo -MD -MP -MF "$(DEPDIR)/MatchFunctor.Tpo" -c -o MatchFunctor.lo `test -f 'attribute/filtering/impl/MatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/MatchFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/MatchFunctor.Tpo" "$(DEPDIR)/MatchFunctor.Plo"; else rm -f "$(DEPDIR)/MatchFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/MatchFunctor.cpp' object='MatchFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MatchFunctor.lo `test -f 'attribute/filtering/impl/MatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/MatchFunctor.cpp + +AndMatchFunctor.lo: attribute/filtering/impl/AndMatchFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AndMatchFunctor.lo -MD -MP -MF "$(DEPDIR)/AndMatchFunctor.Tpo" -c -o AndMatchFunctor.lo `test -f 'attribute/filtering/impl/AndMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AndMatchFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AndMatchFunctor.Tpo" "$(DEPDIR)/AndMatchFunctor.Plo"; else rm -f "$(DEPDIR)/AndMatchFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AndMatchFunctor.cpp' object='AndMatchFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AndMatchFunctor.lo `test -f 'attribute/filtering/impl/AndMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AndMatchFunctor.cpp + +AnyMatchFunctor.lo: attribute/filtering/impl/AnyMatchFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AnyMatchFunctor.lo -MD -MP -MF "$(DEPDIR)/AnyMatchFunctor.Tpo" -c -o AnyMatchFunctor.lo `test -f 'attribute/filtering/impl/AnyMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AnyMatchFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AnyMatchFunctor.Tpo" "$(DEPDIR)/AnyMatchFunctor.Plo"; else rm -f "$(DEPDIR)/AnyMatchFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AnyMatchFunctor.cpp' object='AnyMatchFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AnyMatchFunctor.lo `test -f 'attribute/filtering/impl/AnyMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AnyMatchFunctor.cpp + +NotMatchFunctor.lo: attribute/filtering/impl/NotMatchFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NotMatchFunctor.lo -MD -MP -MF "$(DEPDIR)/NotMatchFunctor.Tpo" -c -o NotMatchFunctor.lo `test -f 'attribute/filtering/impl/NotMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/NotMatchFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/NotMatchFunctor.Tpo" "$(DEPDIR)/NotMatchFunctor.Plo"; else rm -f "$(DEPDIR)/NotMatchFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/NotMatchFunctor.cpp' object='NotMatchFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NotMatchFunctor.lo `test -f 'attribute/filtering/impl/NotMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/NotMatchFunctor.cpp + +OrMatchFunctor.lo: attribute/filtering/impl/OrMatchFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OrMatchFunctor.lo -MD -MP -MF "$(DEPDIR)/OrMatchFunctor.Tpo" -c -o OrMatchFunctor.lo `test -f 'attribute/filtering/impl/OrMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/OrMatchFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/OrMatchFunctor.Tpo" "$(DEPDIR)/OrMatchFunctor.Plo"; else rm -f "$(DEPDIR)/OrMatchFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/OrMatchFunctor.cpp' object='OrMatchFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OrMatchFunctor.lo `test -f 'attribute/filtering/impl/OrMatchFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/OrMatchFunctor.cpp + +AttributeIssuerStringFunctor.lo: attribute/filtering/impl/AttributeIssuerStringFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeIssuerStringFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeIssuerStringFunctor.Tpo" -c -o AttributeIssuerStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeIssuerStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeIssuerStringFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeIssuerStringFunctor.Tpo" "$(DEPDIR)/AttributeIssuerStringFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeIssuerStringFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeIssuerStringFunctor.cpp' object='AttributeIssuerStringFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeIssuerStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeIssuerStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeIssuerStringFunctor.cpp + +AttributeRequesterStringFunctor.lo: attribute/filtering/impl/AttributeRequesterStringFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeRequesterStringFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeRequesterStringFunctor.Tpo" -c -o AttributeRequesterStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeRequesterStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeRequesterStringFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeRequesterStringFunctor.Tpo" "$(DEPDIR)/AttributeRequesterStringFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeRequesterStringFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeRequesterStringFunctor.cpp' object='AttributeRequesterStringFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeRequesterStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeRequesterStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeRequesterStringFunctor.cpp + +AttributeScopeStringFunctor.lo: attribute/filtering/impl/AttributeScopeStringFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeScopeStringFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeScopeStringFunctor.Tpo" -c -o AttributeScopeStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeScopeStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeScopeStringFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeScopeStringFunctor.Tpo" "$(DEPDIR)/AttributeScopeStringFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeScopeStringFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeScopeStringFunctor.cpp' object='AttributeScopeStringFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeScopeStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeScopeStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeScopeStringFunctor.cpp + +AttributeValueStringFunctor.lo: attribute/filtering/impl/AttributeValueStringFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeValueStringFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeValueStringFunctor.Tpo" -c -o AttributeValueStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeValueStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeValueStringFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeValueStringFunctor.Tpo" "$(DEPDIR)/AttributeValueStringFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeValueStringFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeValueStringFunctor.cpp' object='AttributeValueStringFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeValueStringFunctor.lo `test -f 'attribute/filtering/impl/AttributeValueStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeValueStringFunctor.cpp + +AuthenticationMethodStringFunctor.lo: attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AuthenticationMethodStringFunctor.lo -MD -MP -MF "$(DEPDIR)/AuthenticationMethodStringFunctor.Tpo" -c -o AuthenticationMethodStringFunctor.lo `test -f 'attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AuthenticationMethodStringFunctor.Tpo" "$(DEPDIR)/AuthenticationMethodStringFunctor.Plo"; else rm -f "$(DEPDIR)/AuthenticationMethodStringFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp' object='AuthenticationMethodStringFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AuthenticationMethodStringFunctor.lo `test -f 'attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp + +AttributeIssuerRegexFunctor.lo: attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeIssuerRegexFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeIssuerRegexFunctor.Tpo" -c -o AttributeIssuerRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeIssuerRegexFunctor.Tpo" "$(DEPDIR)/AttributeIssuerRegexFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeIssuerRegexFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp' object='AttributeIssuerRegexFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeIssuerRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp + +AttributeRequesterRegexFunctor.lo: attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeRequesterRegexFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeRequesterRegexFunctor.Tpo" -c -o AttributeRequesterRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeRequesterRegexFunctor.Tpo" "$(DEPDIR)/AttributeRequesterRegexFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeRequesterRegexFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp' object='AttributeRequesterRegexFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeRequesterRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp + +AttributeScopeRegexFunctor.lo: attribute/filtering/impl/AttributeScopeRegexFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeScopeRegexFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeScopeRegexFunctor.Tpo" -c -o AttributeScopeRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeScopeRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeScopeRegexFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeScopeRegexFunctor.Tpo" "$(DEPDIR)/AttributeScopeRegexFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeScopeRegexFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeScopeRegexFunctor.cpp' object='AttributeScopeRegexFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeScopeRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeScopeRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeScopeRegexFunctor.cpp + +AttributeValueRegexFunctor.lo: attribute/filtering/impl/AttributeValueRegexFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeValueRegexFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeValueRegexFunctor.Tpo" -c -o AttributeValueRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeValueRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeValueRegexFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeValueRegexFunctor.Tpo" "$(DEPDIR)/AttributeValueRegexFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeValueRegexFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeValueRegexFunctor.cpp' object='AttributeValueRegexFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeValueRegexFunctor.lo `test -f 'attribute/filtering/impl/AttributeValueRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeValueRegexFunctor.cpp + +AuthenticationMethodRegexFunctor.lo: attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AuthenticationMethodRegexFunctor.lo -MD -MP -MF "$(DEPDIR)/AuthenticationMethodRegexFunctor.Tpo" -c -o AuthenticationMethodRegexFunctor.lo `test -f 'attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AuthenticationMethodRegexFunctor.Tpo" "$(DEPDIR)/AuthenticationMethodRegexFunctor.Plo"; else rm -f "$(DEPDIR)/AuthenticationMethodRegexFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp' object='AuthenticationMethodRegexFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AuthenticationMethodRegexFunctor.lo `test -f 'attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp + +NumberOfAttributeValuesFunctor.lo: attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NumberOfAttributeValuesFunctor.lo -MD -MP -MF "$(DEPDIR)/NumberOfAttributeValuesFunctor.Tpo" -c -o NumberOfAttributeValuesFunctor.lo `test -f 'attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/NumberOfAttributeValuesFunctor.Tpo" "$(DEPDIR)/NumberOfAttributeValuesFunctor.Plo"; else rm -f "$(DEPDIR)/NumberOfAttributeValuesFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp' object='NumberOfAttributeValuesFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NumberOfAttributeValuesFunctor.lo `test -f 'attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp + +AttributeIssuerInEntityGroupFunctor.lo: attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeIssuerInEntityGroupFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeIssuerInEntityGroupFunctor.Tpo" -c -o AttributeIssuerInEntityGroupFunctor.lo `test -f 'attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeIssuerInEntityGroupFunctor.Tpo" "$(DEPDIR)/AttributeIssuerInEntityGroupFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeIssuerInEntityGroupFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp' object='AttributeIssuerInEntityGroupFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeIssuerInEntityGroupFunctor.lo `test -f 'attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp + +AttributeRequesterInEntityGroupFunctor.lo: attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeRequesterInEntityGroupFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeRequesterInEntityGroupFunctor.Tpo" -c -o AttributeRequesterInEntityGroupFunctor.lo `test -f 'attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeRequesterInEntityGroupFunctor.Tpo" "$(DEPDIR)/AttributeRequesterInEntityGroupFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeRequesterInEntityGroupFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp' object='AttributeRequesterInEntityGroupFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeRequesterInEntityGroupFunctor.lo `test -f 'attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp + +AttributeScopeMatchesShibMDScopeFunctor.lo: attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AttributeScopeMatchesShibMDScopeFunctor.lo -MD -MP -MF "$(DEPDIR)/AttributeScopeMatchesShibMDScopeFunctor.Tpo" -c -o AttributeScopeMatchesShibMDScopeFunctor.lo `test -f 'attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/AttributeScopeMatchesShibMDScopeFunctor.Tpo" "$(DEPDIR)/AttributeScopeMatchesShibMDScopeFunctor.Plo"; else rm -f "$(DEPDIR)/AttributeScopeMatchesShibMDScopeFunctor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp' object='AttributeScopeMatchesShibMDScopeFunctor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AttributeScopeMatchesShibMDScopeFunctor.lo `test -f 'attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp' || echo '$(srcdir)/'`attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp + +ChainingAttributeResolver.lo: attribute/resolver/impl/ChainingAttributeResolver.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ChainingAttributeResolver.lo -MD -MP -MF "$(DEPDIR)/ChainingAttributeResolver.Tpo" -c -o ChainingAttributeResolver.lo `test -f 'attribute/resolver/impl/ChainingAttributeResolver.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/ChainingAttributeResolver.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ChainingAttributeResolver.Tpo" "$(DEPDIR)/ChainingAttributeResolver.Plo"; else rm -f "$(DEPDIR)/ChainingAttributeResolver.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/resolver/impl/ChainingAttributeResolver.cpp' object='ChainingAttributeResolver.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ChainingAttributeResolver.lo `test -f 'attribute/resolver/impl/ChainingAttributeResolver.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/ChainingAttributeResolver.cpp + +QueryAttributeResolver.lo: attribute/resolver/impl/QueryAttributeResolver.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT QueryAttributeResolver.lo -MD -MP -MF "$(DEPDIR)/QueryAttributeResolver.Tpo" -c -o QueryAttributeResolver.lo `test -f 'attribute/resolver/impl/QueryAttributeResolver.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/QueryAttributeResolver.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/QueryAttributeResolver.Tpo" "$(DEPDIR)/QueryAttributeResolver.Plo"; else rm -f "$(DEPDIR)/QueryAttributeResolver.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/resolver/impl/QueryAttributeResolver.cpp' object='QueryAttributeResolver.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o QueryAttributeResolver.lo `test -f 'attribute/resolver/impl/QueryAttributeResolver.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/QueryAttributeResolver.cpp + +ChainingAttributeExtractor.lo: attribute/resolver/impl/ChainingAttributeExtractor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ChainingAttributeExtractor.lo -MD -MP -MF "$(DEPDIR)/ChainingAttributeExtractor.Tpo" -c -o ChainingAttributeExtractor.lo `test -f 'attribute/resolver/impl/ChainingAttributeExtractor.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/ChainingAttributeExtractor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ChainingAttributeExtractor.Tpo" "$(DEPDIR)/ChainingAttributeExtractor.Plo"; else rm -f "$(DEPDIR)/ChainingAttributeExtractor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/resolver/impl/ChainingAttributeExtractor.cpp' object='ChainingAttributeExtractor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ChainingAttributeExtractor.lo `test -f 'attribute/resolver/impl/ChainingAttributeExtractor.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/ChainingAttributeExtractor.cpp + +XMLAttributeExtractor.lo: attribute/resolver/impl/XMLAttributeExtractor.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XMLAttributeExtractor.lo -MD -MP -MF "$(DEPDIR)/XMLAttributeExtractor.Tpo" -c -o XMLAttributeExtractor.lo `test -f 'attribute/resolver/impl/XMLAttributeExtractor.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/XMLAttributeExtractor.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/XMLAttributeExtractor.Tpo" "$(DEPDIR)/XMLAttributeExtractor.Plo"; else rm -f "$(DEPDIR)/XMLAttributeExtractor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/resolver/impl/XMLAttributeExtractor.cpp' object='XMLAttributeExtractor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XMLAttributeExtractor.lo `test -f 'attribute/resolver/impl/XMLAttributeExtractor.cpp' || echo '$(srcdir)/'`attribute/resolver/impl/XMLAttributeExtractor.cpp + +ArtifactResolver.lo: binding/impl/ArtifactResolver.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ArtifactResolver.lo -MD -MP -MF "$(DEPDIR)/ArtifactResolver.Tpo" -c -o ArtifactResolver.lo `test -f 'binding/impl/ArtifactResolver.cpp' || echo '$(srcdir)/'`binding/impl/ArtifactResolver.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ArtifactResolver.Tpo" "$(DEPDIR)/ArtifactResolver.Plo"; else rm -f "$(DEPDIR)/ArtifactResolver.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='binding/impl/ArtifactResolver.cpp' object='ArtifactResolver.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ArtifactResolver.lo `test -f 'binding/impl/ArtifactResolver.cpp' || echo '$(srcdir)/'`binding/impl/ArtifactResolver.cpp + +SOAPClient.lo: binding/impl/SOAPClient.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SOAPClient.lo -MD -MP -MF "$(DEPDIR)/SOAPClient.Tpo" -c -o SOAPClient.lo `test -f 'binding/impl/SOAPClient.cpp' || echo '$(srcdir)/'`binding/impl/SOAPClient.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SOAPClient.Tpo" "$(DEPDIR)/SOAPClient.Plo"; else rm -f "$(DEPDIR)/SOAPClient.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='binding/impl/SOAPClient.cpp' object='SOAPClient.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SOAPClient.lo `test -f 'binding/impl/SOAPClient.cpp' || echo '$(srcdir)/'`binding/impl/SOAPClient.cpp + +MetadataExtImpl.lo: metadata/MetadataExtImpl.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MetadataExtImpl.lo -MD -MP -MF "$(DEPDIR)/MetadataExtImpl.Tpo" -c -o MetadataExtImpl.lo `test -f 'metadata/MetadataExtImpl.cpp' || echo '$(srcdir)/'`metadata/MetadataExtImpl.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/MetadataExtImpl.Tpo" "$(DEPDIR)/MetadataExtImpl.Plo"; else rm -f "$(DEPDIR)/MetadataExtImpl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='metadata/MetadataExtImpl.cpp' object='MetadataExtImpl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MetadataExtImpl.lo `test -f 'metadata/MetadataExtImpl.cpp' || echo '$(srcdir)/'`metadata/MetadataExtImpl.cpp + +MetadataExtSchemaValidators.lo: metadata/MetadataExtSchemaValidators.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MetadataExtSchemaValidators.lo -MD -MP -MF "$(DEPDIR)/MetadataExtSchemaValidators.Tpo" -c -o MetadataExtSchemaValidators.lo `test -f 'metadata/MetadataExtSchemaValidators.cpp' || echo '$(srcdir)/'`metadata/MetadataExtSchemaValidators.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/MetadataExtSchemaValidators.Tpo" "$(DEPDIR)/MetadataExtSchemaValidators.Plo"; else rm -f "$(DEPDIR)/MetadataExtSchemaValidators.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='metadata/MetadataExtSchemaValidators.cpp' object='MetadataExtSchemaValidators.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MetadataExtSchemaValidators.lo `test -f 'metadata/MetadataExtSchemaValidators.cpp' || echo '$(srcdir)/'`metadata/MetadataExtSchemaValidators.cpp + +PKIXTrustEngine.lo: security/PKIXTrustEngine.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PKIXTrustEngine.lo -MD -MP -MF "$(DEPDIR)/PKIXTrustEngine.Tpo" -c -o PKIXTrustEngine.lo `test -f 'security/PKIXTrustEngine.cpp' || echo '$(srcdir)/'`security/PKIXTrustEngine.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/PKIXTrustEngine.Tpo" "$(DEPDIR)/PKIXTrustEngine.Plo"; else rm -f "$(DEPDIR)/PKIXTrustEngine.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='security/PKIXTrustEngine.cpp' object='PKIXTrustEngine.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PKIXTrustEngine.lo `test -f 'security/PKIXTrustEngine.cpp' || echo '$(srcdir)/'`security/PKIXTrustEngine.cpp + +SecurityPolicy.lo: security/SecurityPolicy.cpp +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SecurityPolicy.lo -MD -MP -MF "$(DEPDIR)/SecurityPolicy.Tpo" -c -o SecurityPolicy.lo `test -f 'security/SecurityPolicy.cpp' || echo '$(srcdir)/'`security/SecurityPolicy.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SecurityPolicy.Tpo" "$(DEPDIR)/SecurityPolicy.Plo"; else rm -f "$(DEPDIR)/SecurityPolicy.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='security/SecurityPolicy.cpp' object='SecurityPolicy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SecurityPolicy.lo `test -f 'security/SecurityPolicy.cpp' || echo '$(srcdir)/'`security/SecurityPolicy.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-attrfiltincludeHEADERS: $(attrfiltinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(attrfiltincludedir)" || $(mkdir_p) "$(DESTDIR)$(attrfiltincludedir)" + @list='$(attrfiltinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(attrfiltincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(attrfiltincludedir)/$$f'"; \ + $(attrfiltincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(attrfiltincludedir)/$$f"; \ + done + +uninstall-attrfiltincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(attrfiltinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(attrfiltincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(attrfiltincludedir)/$$f"; \ + done +install-attrincludeHEADERS: $(attrinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(attrincludedir)" || $(mkdir_p) "$(DESTDIR)$(attrincludedir)" + @list='$(attrinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(attrincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(attrincludedir)/$$f'"; \ + $(attrincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(attrincludedir)/$$f"; \ + done + +uninstall-attrincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(attrinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(attrincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(attrincludedir)/$$f"; \ + done +install-attrresincludeHEADERS: $(attrresinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(attrresincludedir)" || $(mkdir_p) "$(DESTDIR)$(attrresincludedir)" + @list='$(attrresinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(attrresincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(attrresincludedir)/$$f'"; \ + $(attrresincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(attrresincludedir)/$$f"; \ + done + +uninstall-attrresincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(attrresinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(attrresincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(attrresincludedir)/$$f"; \ + done +install-bindincludeHEADERS: $(bindinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(bindincludedir)" || $(mkdir_p) "$(DESTDIR)$(bindincludedir)" + @list='$(bindinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(bindincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(bindincludedir)/$$f'"; \ + $(bindincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(bindincludedir)/$$f"; \ + done + +uninstall-bindincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(bindinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(bindincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindincludedir)/$$f"; \ + done +install-handincludeHEADERS: $(handinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(handincludedir)" || $(mkdir_p) "$(DESTDIR)$(handincludedir)" + @list='$(handinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(handincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(handincludedir)/$$f'"; \ + $(handincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(handincludedir)/$$f"; \ + done + +uninstall-handincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(handinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(handincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(handincludedir)/$$f"; \ + done +install-libshibspincludeHEADERS: $(libshibspinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(libshibspincludedir)" || $(mkdir_p) "$(DESTDIR)$(libshibspincludedir)" + @list='$(libshibspinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(libshibspincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libshibspincludedir)/$$f'"; \ + $(libshibspincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libshibspincludedir)/$$f"; \ + done + +uninstall-libshibspincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libshibspinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libshibspincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(libshibspincludedir)/$$f"; \ + done +install-liteincludeHEADERS: $(liteinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(liteincludedir)" || $(mkdir_p) "$(DESTDIR)$(liteincludedir)" + @list='$(liteinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(liteincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(liteincludedir)/$$f'"; \ + $(liteincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(liteincludedir)/$$f"; \ + done + +uninstall-liteincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(liteinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(liteincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(liteincludedir)/$$f"; \ + done +install-mdincludeHEADERS: $(mdinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(mdincludedir)" || $(mkdir_p) "$(DESTDIR)$(mdincludedir)" + @list='$(mdinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(mdincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(mdincludedir)/$$f'"; \ + $(mdincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(mdincludedir)/$$f"; \ + done + +uninstall-mdincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(mdinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(mdincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(mdincludedir)/$$f"; \ + done +install-remincludeHEADERS: $(reminclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(remincludedir)" || $(mkdir_p) "$(DESTDIR)$(remincludedir)" + @list='$(reminclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(remincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(remincludedir)/$$f'"; \ + $(remincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(remincludedir)/$$f"; \ + done + +uninstall-remincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(reminclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(remincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(remincludedir)/$$f"; \ + done +install-secincludeHEADERS: $(secinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(secincludedir)" || $(mkdir_p) "$(DESTDIR)$(secincludedir)" + @list='$(secinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(secincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(secincludedir)/$$f'"; \ + $(secincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(secincludedir)/$$f"; \ + done + +uninstall-secincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(secinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(secincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(secincludedir)/$$f"; \ + done +install-utilincludeHEADERS: $(utilinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(utilincludedir)" || $(mkdir_p) "$(DESTDIR)$(utilincludedir)" + @list='$(utilinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(utilincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(utilincludedir)/$$f'"; \ + $(utilincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(utilincludedir)/$$f"; \ + done + +uninstall-utilincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(utilinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(utilincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(utilincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(mkdir_p) $(distdir)/attribute $(distdir)/attribute/filtering $(distdir)/attribute/resolver $(distdir)/binding $(distdir)/handler $(distdir)/lite $(distdir)/metadata $(distdir)/remoting $(distdir)/remoting/impl $(distdir)/security $(distdir)/util + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(attrfiltincludedir)" "$(DESTDIR)$(attrincludedir)" "$(DESTDIR)$(attrresincludedir)" "$(DESTDIR)$(bindincludedir)" "$(DESTDIR)$(handincludedir)" "$(DESTDIR)$(libshibspincludedir)" "$(DESTDIR)$(liteincludedir)" "$(DESTDIR)$(mdincludedir)" "$(DESTDIR)$(remincludedir)" "$(DESTDIR)$(secincludedir)" "$(DESTDIR)$(utilincludedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-attrfiltincludeHEADERS \ + install-attrincludeHEADERS install-attrresincludeHEADERS \ + install-bindincludeHEADERS install-handincludeHEADERS \ + install-libshibspincludeHEADERS install-liteincludeHEADERS \ + install-mdincludeHEADERS install-remincludeHEADERS \ + install-secincludeHEADERS install-utilincludeHEADERS + +install-exec-am: install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-attrfiltincludeHEADERS \ + uninstall-attrincludeHEADERS uninstall-attrresincludeHEADERS \ + uninstall-bindincludeHEADERS uninstall-handincludeHEADERS \ + uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-libshibspincludeHEADERS uninstall-liteincludeHEADERS \ + uninstall-mdincludeHEADERS uninstall-remincludeHEADERS \ + uninstall-secincludeHEADERS uninstall-utilincludeHEADERS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-attrfiltincludeHEADERS \ + install-attrincludeHEADERS install-attrresincludeHEADERS \ + install-bindincludeHEADERS install-data install-data-am \ + install-exec install-exec-am install-exec-hook \ + install-handincludeHEADERS install-info install-info-am \ + install-libLTLIBRARIES install-libshibspincludeHEADERS \ + install-liteincludeHEADERS install-man \ + install-mdincludeHEADERS install-remincludeHEADERS \ + install-secincludeHEADERS install-strip \ + install-utilincludeHEADERS installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-attrfiltincludeHEADERS \ + uninstall-attrincludeHEADERS uninstall-attrresincludeHEADERS \ + uninstall-bindincludeHEADERS uninstall-handincludeHEADERS \ + uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-libshibspincludeHEADERS uninstall-liteincludeHEADERS \ + uninstall-mdincludeHEADERS uninstall-remincludeHEADERS \ + uninstall-secincludeHEADERS uninstall-utilincludeHEADERS + + +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:@-OPENSAMLXMLDIR-@:${OPENSAMLXMLDIR}:g' + cmp -s $@ $@.tmp || mv $@.tmp $@ + rm -f $@.tmp + +install-exec-hook: + for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/shibsp/RequestMapper.h b/shibsp/RequestMapper.h new file mode 100644 index 0000000..646cbdd --- /dev/null +++ b/shibsp/RequestMapper.h @@ -0,0 +1,73 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/RequestMapper.h + * + * Interface to a request mapping plugin + */ + +#ifndef __shibsp_reqmap_h__ +#define __shibsp_reqmap_h__ + +#include +#include +#include + +namespace shibsp { + + class SHIBSP_API AccessControl; + class SHIBSP_API PropertySet; + + /** + * Interface to a request mapping plugin + * + * Request mapping plugins return configuration settings that apply to resource requests. + * They can be implemented through cross-platform or platform-specific mechanisms. + */ + class SHIBSP_API RequestMapper : public virtual xmltooling::Lockable + { + MAKE_NONCOPYABLE(RequestMapper); + protected: + RequestMapper() {} + public: + virtual ~RequestMapper() {} + + /** Combination of configuration settings and effective access control. */ + typedef std::pair Settings; + + /** + * Map request to settings. + * + * @param request SP request + * @return configuration settings and effective AccessControl plugin, if any + */ + virtual Settings getSettings(const xmltooling::HTTPRequest& request) const=0; + }; + + /** + * Registers RequestMapper classes into the runtime. + */ + void SHIBSP_API registerRequestMappers(); + + /** XML-based RequestMapper implementation. */ + #define XML_REQUEST_MAPPER "XML" + + /** Hybrid of XML and platform-specific configuration. */ + #define NATIVE_REQUEST_MAPPER "Native" +}; + +#endif /* __shibsp_reqmap_h__ */ diff --git a/shibsp/SPConfig.cpp b/shibsp/SPConfig.cpp new file mode 100644 index 0000000..65d5b74 --- /dev/null +++ b/shibsp/SPConfig.cpp @@ -0,0 +1,253 @@ + +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SPConfig.cpp + * + * Library configuration + */ + +#include "internal.h" + +#if defined(XMLTOOLING_LOG4SHIB) +# ifndef SHIBSP_LOG4SHIB +# error "Logging library mismatch (XMLTooling is using log4shib)." +# endif +#elif defined(XMLTOOLING_LOG4CPP) +# ifndef SHIBSP_LOG4CPP +# error "Logging library mismatch (XMLTooling is using log4cpp)." +# endif +#else +# error "No supported logging library." +#endif + +#include "AccessControl.h" +#include "exceptions.h" +#include "RequestMapper.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "SPConfig.h" +#include "attribute/Attribute.h" +#include "handler/SessionInitiator.h" +#include "remoting/ListenerService.h" + +#ifndef SHIBSP_LITE +# include "attribute/AttributeDecoder.h" +# include "attribute/filtering/AttributeFilter.h" +# include "attribute/filtering/MatchFunctor.h" +# include "attribute/resolver/AttributeExtractor.h" +# include "attribute/resolver/AttributeResolver.h" +# include "binding/ArtifactResolver.h" +# include "metadata/MetadataExt.h" +# include "security/PKIXTrustEngine.h" +# include +# include +#else +# include +#endif + +#include +#include +#include + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; + +DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeException,shibsp); +DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeExtractionException,shibsp); +DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeFilteringException,shibsp); +DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeResolutionException,shibsp); +DECL_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp); +DECL_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp); + +#ifdef SHIBSP_LITE +DECL_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml); +DECL_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml); +DECL_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml); +DECL_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml); +DECL_XMLTOOLING_EXCEPTION_FACTORY(RetryableProfileException,opensaml); +DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md); +#endif + +namespace shibsp { + SPConfig g_config; +} + +SPConfig& SPConfig::getConfig() +{ + return g_config; +} + +void SPConfig::setServiceProvider(ServiceProvider* serviceProvider) +{ + delete m_serviceProvider; + m_serviceProvider = serviceProvider; +} + +bool SPConfig::init(const char* catalog_path, const char* inst_prefix) +{ +#ifdef _DEBUG + NDC ndc("init"); +#endif + if (!inst_prefix) + inst_prefix = getenv("SHIBSP_PREFIX"); + if (!inst_prefix) + inst_prefix = SHIBSP_PREFIX; + + const char* loglevel=getenv("SHIBSP_LOGGING"); + if (!loglevel) + loglevel = SHIBSP_LOGGING; + std::string ll(loglevel); + PathResolver localpr; + XMLToolingConfig::getConfig().log_config(localpr.resolve(ll, PathResolver::XMLTOOLING_CFG_FILE, PACKAGE_NAME, inst_prefix).c_str()); + + Category& log=Category::getInstance(SHIBSP_LOGCAT".Config"); + log.debug("%s library initialization started", PACKAGE_STRING); + + if (!catalog_path) + catalog_path = getenv("SHIBSP_SCHEMAS"); + if (!catalog_path) + catalog_path = SHIBSP_SCHEMAS; + XMLToolingConfig::getConfig().catalog_path = catalog_path; + +#ifndef SHIBSP_LITE + if (!SAMLConfig::getConfig().init()) { + log.fatal("failed to initialize OpenSAML library"); + return false; + } + XMLPlatformUtils::fgNetAccessor = new CurlNetAccessor(); +#else + if (!XMLToolingConfig::getConfig().init()) { + log.fatal("failed to initialize XMLTooling library"); + return false; + } +#endif + XMLToolingConfig::getConfig().getPathResolver()->setDefaultPackageName(PACKAGE_NAME); + XMLToolingConfig::getConfig().getPathResolver()->setDefaultPrefix(inst_prefix); + XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine()); + XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp"); + + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeException,shibsp); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeExtractionException,shibsp); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeFilteringException,shibsp); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeResolutionException,shibsp); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp); + +#ifdef SHIBSP_LITE + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(RetryableProfileException,opensaml); + REGISTER_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md); +#endif + +#ifndef SHIBSP_LITE + if (isEnabled(Metadata)) + registerMetadataExtClasses(); + if (isEnabled(Trust)) + registerPKIXTrustEngine(); +#endif + + registerAttributeFactories(); + registerHandlers(); + registerSessionInitiators(); + registerServiceProviders(); + +#ifndef SHIBSP_LITE + if (isEnabled(AttributeResolution)) { + registerAttributeExtractors(); + registerAttributeDecoders(); + registerAttributeResolvers(); + registerAttributeFilters(); + registerMatchFunctors(); + } +#endif + + if (isEnabled(Listener)) + registerListenerServices(); + + if (isEnabled(RequestMapping)) { + registerAccessControls(); + registerRequestMappers(); + } + + if (isEnabled(Caching)) + registerSessionCaches(); + +#ifndef SHIBSP_LITE + if (isEnabled(OutOfProcess)) + m_artifactResolver = new ArtifactResolver(); +#endif + + log.info("%s library initialization complete", PACKAGE_STRING); + return true; +} + +void SPConfig::term() +{ +#ifdef _DEBUG + NDC ndc("term"); +#endif + Category& log=Category::getInstance(SHIBSP_LOGCAT".Config"); + log.info("%s library shutting down", PACKAGE_STRING); + + setServiceProvider(NULL); +#ifndef SHIBSP_LITE + setArtifactResolver(NULL); +#endif + + ArtifactResolutionServiceManager.deregisterFactories(); + AssertionConsumerServiceManager.deregisterFactories(); + LogoutInitiatorManager.deregisterFactories(); + ManageNameIDServiceManager.deregisterFactories(); + SessionInitiatorManager.deregisterFactories(); + SingleLogoutServiceManager.deregisterFactories(); + HandlerManager.deregisterFactories(); + ServiceProviderManager.deregisterFactories(); + Attribute::deregisterFactories(); + +#ifndef SHIBSP_LITE + if (isEnabled(AttributeResolution)) { + MatchFunctorManager.deregisterFactories(); + AttributeFilterManager.deregisterFactories(); + AttributeDecoderManager.deregisterFactories(); + AttributeExtractorManager.deregisterFactories(); + AttributeResolverManager.deregisterFactories(); + } +#endif + + if (isEnabled(Listener)) + ListenerServiceManager.deregisterFactories(); + + if (isEnabled(RequestMapping)) { + AccessControlManager.deregisterFactories(); + RequestMapperManager.deregisterFactories(); + } + + if (isEnabled(Caching)) + SessionCacheManager.deregisterFactories(); + +#ifndef SHIBSP_LITE + SAMLConfig::getConfig().term(); +#else + XMLToolingConfig::getConfig().term(); +#endif + log.info("%s library shutdown complete", PACKAGE_STRING); +} diff --git a/shibsp/SPConfig.h b/shibsp/SPConfig.h new file mode 100644 index 0000000..81499cd --- /dev/null +++ b/shibsp/SPConfig.h @@ -0,0 +1,292 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/SPConfig.h + * + * Library configuration + */ + +#ifndef __shibsp_config_h__ +#define __shibsp_config_h__ + +#include +#ifndef SHIBSP_LITE +# include +#endif +#include +#include + +/** + * @namespace shibsp + * Shibboleth Service Provider Library + */ +namespace shibsp { + + class SHIBSP_API AccessControl; + class SHIBSP_API Handler; + class SHIBSP_API ListenerService; + class SHIBSP_API RequestMapper; + class SHIBSP_API ServiceProvider; + class SHIBSP_API SessionCache; + class SHIBSP_API SessionInitiator; + +#ifndef SHIBSP_LITE + class SHIBSP_API AttributeDecoder; + class SHIBSP_API AttributeExtractor; + class SHIBSP_API AttributeFilter; + class SHIBSP_API AttributeResolver; + class SHIBSP_API FilterPolicyContext; + class SHIBSP_API MatchFunctor; +#endif + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 4251 ) +#endif + + /** + * Singleton object that manages library startup/shutdown. + */ + class SHIBSP_API SPConfig + { + MAKE_NONCOPYABLE(SPConfig); + public: + SPConfig() : attribute_value_delimeter(';'), m_serviceProvider(NULL), +#ifndef SHIBSP_LITE + m_artifactResolver(NULL), +#endif + m_features(0) {} + + virtual ~SPConfig() {} + + /** + * Returns the global configuration object for the library. + * + * @return reference to the global library configuration object + */ + static SPConfig& getConfig(); + + /** + * Bitmask values representing subsystems of the library. + */ + enum components_t { + Listener = 1, + Caching = 2, +#ifndef SHIBSP_LITE + Metadata = 4, + Trust = 8, + Credentials = 16, + AttributeResolution = 32, +#endif + RequestMapping = 64, + OutOfProcess = 128, + InProcess = 256, + Logging = 512, + Handlers = 1024 + }; + + /** + * Set a bitmask of subsystems to activate. + * + * @param enabled bitmask of component constants + */ + void setFeatures(unsigned long enabled) { + m_features = enabled; + } + + /** + * Test whether a subsystem is enabled. + * + * @param feature subsystem/component to test + * @return true iff feature is enabled + */ + bool isEnabled(components_t feature) { + return (m_features & feature)>0; + } + + /** + * Initializes library + * + * Each process using the library MUST call this function exactly once + * before using any library classes. + * + * @param catalog_path delimited set of schema catalog files to load + * @param inst_prefix installation prefix for software + * @return true iff initialization was successful + */ + virtual bool init(const char* catalog_path=NULL, const char* inst_prefix=NULL); + + /** + * Shuts down library + * + * Each process using the library SHOULD call this function exactly once + * before terminating itself. + */ + virtual void term(); + + /** + * Sets the global ServiceProvider instance. + * This method must be externally synchronized with any code that uses the object. + * Any previously set object is destroyed. + * + * @param serviceProvider new ServiceProvider instance to store + */ + void setServiceProvider(ServiceProvider* serviceProvider); + + /** + * Returns the global ServiceProvider instance. + * + * @return global ServiceProvider or NULL + */ + ServiceProvider* getServiceProvider() const { + return m_serviceProvider; + } + +#ifndef SHIBSP_LITE + /** + * Sets the global ArtifactResolver instance. + * + *

This method must be externally synchronized with any code that uses the object. + * Any previously set object is destroyed. + * + * @param artifactResolver new ArtifactResolver instance to store + */ + void setArtifactResolver(opensaml::MessageDecoder::ArtifactResolver* artifactResolver) { + delete m_artifactResolver; + m_artifactResolver = artifactResolver; + } + + /** + * Returns the global ArtifactResolver instance. + * + * @return global ArtifactResolver or NULL + */ + opensaml::MessageDecoder::ArtifactResolver* getArtifactResolver() const { + return m_artifactResolver; + } +#endif + + /** Separator for serialized values of multi-valued attributes. */ + char attribute_value_delimeter; + + /** + * Manages factories for AccessControl plugins. + */ + xmltooling::PluginManager AccessControlManager; + +#ifndef SHIBSP_LITE + /** + * Manages factories for AttributeDecoder plugins. + */ + xmltooling::PluginManager AttributeDecoderManager; + + /** + * Manages factories for AttributeExtractor plugins. + */ + xmltooling::PluginManager AttributeExtractorManager; + + /** + * Manages factories for AttributeFilter plugins. + */ + xmltooling::PluginManager AttributeFilterManager; + + /** + * Manages factories for AttributeResolver plugins. + */ + xmltooling::PluginManager AttributeResolverManager; + + /** + * Manages factories for MatchFunctor plugins. + */ + xmltooling::PluginManager< MatchFunctor,xmltooling::QName,std::pair > MatchFunctorManager; +#endif + + /** + * Manages factories for Handler plugins that implement ArtifactResolutionService functionality. + */ + xmltooling::PluginManager< Handler,std::string,std::pair > ArtifactResolutionServiceManager; + + /** + * Manages factories for Handler plugins that implement AssertionConsumerService functionality. + */ + xmltooling::PluginManager< Handler,std::string,std::pair > AssertionConsumerServiceManager; + + /** + * Manages factories for Handler plugins that implement customized functionality. + */ + xmltooling::PluginManager< Handler,std::string,std::pair > HandlerManager; + + /** + * Manages factories for ListenerService plugins. + */ + xmltooling::PluginManager ListenerServiceManager; + + /** + * Manages factories for Handler plugins that implement LogoutInitiator functionality. + */ + xmltooling::PluginManager< Handler,std::string,std::pair > LogoutInitiatorManager; + + /** + * Manages factories for Handler plugins that implement ManageNameIDService functionality. + */ + xmltooling::PluginManager< Handler,std::string,std::pair > ManageNameIDServiceManager; + + /** + * Manages factories for RequestMapper plugins. + */ + xmltooling::PluginManager RequestMapperManager; + + /** + * Manages factories for ServiceProvider plugins. + */ + xmltooling::PluginManager ServiceProviderManager; + + /** + * Manages factories for SessionCache plugins. + */ + xmltooling::PluginManager SessionCacheManager; + + /** + * Manages factories for Handler plugins that implement SessionInitiator functionality. + */ + xmltooling::PluginManager< SessionInitiator,std::string,std::pair > SessionInitiatorManager; + + /** + * Manages factories for Handler plugins that implement SingleLogoutService functionality. + */ + xmltooling::PluginManager< Handler,std::string,std::pair > SingleLogoutServiceManager; + + protected: + /** Global ServiceProvider instance. */ + ServiceProvider* m_serviceProvider; + +#ifndef SHIBSP_LITE + /** Global ArtifactResolver instance. */ + opensaml::MessageDecoder::ArtifactResolver* m_artifactResolver; +#endif + + private: + unsigned long m_features; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_config_h__ */ diff --git a/shibsp/SPRequest.h b/shibsp/SPRequest.h new file mode 100644 index 0000000..97fadc6 --- /dev/null +++ b/shibsp/SPRequest.h @@ -0,0 +1,169 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/SPRequest.h + * + * Interface to server request being processed + */ + +#ifndef __shibsp_req_h__ +#define __shibsp_req_h__ + +#include +#include +#include + +namespace shibsp { + + class SHIBSP_API Application; + class SHIBSP_API ServiceProvider; + class SHIBSP_API Session; + + /** + * Interface to server request being processed + * + *

To supply information from the surrounding web server environment, + * a shim must be supplied in the form of this interface to adapt the + * library to different proprietary server APIs. + * + *

This interface need not be threadsafe. + */ + class SHIBSP_API SPRequest : public virtual xmltooling::HTTPRequest, public virtual xmltooling::HTTPResponse + { + protected: + SPRequest() {} + public: + virtual ~SPRequest() {} + + /** + * Returns the locked ServiceProvider processing the request. + * + * @return reference to ServiceProvider + */ + virtual const ServiceProvider& getServiceProvider() const=0; + + /** + * Returns RequestMapper Settings associated with the request, guaranteed + * to be valid for the request's duration. + * + * @return copy of settings + */ + virtual RequestMapper::Settings getRequestSettings() const=0; + + /** + * Returns the Application governing the request. + * + * @return reference to Application + */ + virtual const Application& getApplication() const=0; + + /** + * Returns a locked Session associated with the request. + * + * @param checkTimeout true iff the last-used timestamp should be updated and any timeout policy enforced + * @param ignoreAddress true iff all address checking should be ignored, regardless of policy + * @param cache true iff the request should hold the Session lock itself and unlock during cleanup + * @return pointer to Session, or NULL + */ + virtual Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true) const=0; + + /** + * Returns the effective base Handler URL for a resource, + * or the current request URL. + * + * @param resource resource URL to compute handler for + * @return base location of handler + */ + virtual const char* getHandlerURL(const char* resource=NULL) const=0; + + /** + * Returns a non-spoofable request header value, if possible. + * Platforms that support environment export can redirect header + * lookups by overriding this method. + * + * @param name the name of the secure header to return + * @return the header's value, or an empty string + */ + virtual std::string getSecureHeader(const char* name) const { + return getHeader(name); + } + + /** + * Ensures no value exists for a request header. + * + * @param rawname raw name of header to clear + * @param cginame CGI-equivalent name of header + */ + virtual void clearHeader(const char* rawname, const char* cginame)=0; + + /** + * Sets a value for a request header. + * + * @param name name of header to set + * @param value value to set + */ + virtual void setHeader(const char* name, const char* value)=0; + + /** + * Establish REMOTE_USER identity in request. + * + * @param user REMOTE_USER value to set or NULL to clear + */ + virtual void setRemoteUser(const char* user)=0; + + /** Portable logging levels. */ + enum SPLogLevel { + SPDebug, + SPInfo, + SPWarn, + SPError, + SPCrit + }; + + /** + * Log to native server environment. + * + * @param level logging level + * @param msg message to log + */ + virtual void log(SPLogLevel level, const std::string& msg) const=0; + + /** + * Test logging level. + * + * @param level logging level + * @return true iff logging level is enabled + */ + virtual bool isPriorityEnabled(SPLogLevel level) const=0; + + /** + * Indicates that processing was declined, meaning no action is required during this phase of processing. + * + * @return a status code to pass back to the server-specific layer + */ + virtual long returnDecline()=0; + + /** + * Indicates that processing was completed. + * + * @return a status code to pass back to the server-specific layer + */ + virtual long returnOK()=0; + }; +}; + +#endif /* __shibsp_req_h__ */ diff --git a/shibsp/ServiceProvider.cpp b/shibsp/ServiceProvider.cpp new file mode 100644 index 0000000..df7cf81 --- /dev/null +++ b/shibsp/ServiceProvider.cpp @@ -0,0 +1,533 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ServiceProvider.cpp + * + * Interface to a Shibboleth ServiceProvider instance. + */ + +#include "internal.h" +#include "exceptions.h" +#include "AccessControl.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "SPRequest.h" +#include "attribute/Attribute.h" +#include "handler/SessionInitiator.h" +#include "util/TemplateParameters.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling::logging; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + SHIBSP_DLLLOCAL PluginManager::Factory XMLServiceProviderFactory; + + long SHIBSP_DLLLOCAL sendError( + Category& log, SPRequest& request, const Application* app, const char* page, TemplateParameters& tp, bool mayRedirect=true + ) + { + // The properties we need can be set in the RequestMap, or the Errors element. + bool mderror = dynamic_cast(tp.getRichException())!=NULL; + pair redirectErrors = pair(false,NULL); + pair pathname = pair(false,NULL); + const PropertySet* props=app ? app->getPropertySet("Errors") : NULL; + + try { + RequestMapper::Settings settings = request.getRequestSettings(); + if (mderror) + pathname = settings.first->getString("metadataError"); + if (!pathname.first) { + string pagename(page); + pagename += "Error"; + pathname = settings.first->getString(pagename.c_str()); + } + if (mayRedirect) + redirectErrors = settings.first->getString("redirectErrors"); + } + catch (exception& ex) { + log.error(ex.what()); + } + + if (mayRedirect) { + // Check for redirection on errors instead of template. + if (!redirectErrors.first && props) + redirectErrors = props->getString("redirectErrors"); + if (redirectErrors.first) { + string loc(redirectErrors.second); + loc = loc + '?' + tp.toQueryString(); + return request.sendRedirect(loc.c_str()); + } + } + + request.setContentType("text/html"); + request.setResponseHeader("Expires","01-Jan-1997 12:00:00 GMT"); + request.setResponseHeader("Cache-Control","private,no-store,no-cache"); + + if (!pathname.first && props) { + if (mderror) + pathname=props->getString("metadata"); + if (!pathname.first) + pathname=props->getString(page); + } + if (pathname.first) { + string fname(pathname.second); + ifstream infile(XMLToolingConfig::getConfig().getPathResolver()->resolve(fname, PathResolver::XMLTOOLING_CFG_FILE).c_str()); + if (infile) { + tp.setPropertySet(props); + stringstream str; + XMLToolingConfig::getConfig().getTemplateEngine()->run(infile, str, tp, tp.getRichException()); + return request.sendResponse(str); + } + } + + if (!strcmp(page,"access")) { + istringstream msg("Access Denied"); + return request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_UNAUTHORIZED); + } + + log.error("sendError could not process error template (%s)", page); + istringstream msg("Internal Server Error. Please contact the site administrator."); + return request.sendError(msg); + } + + void SHIBSP_DLLLOCAL clearHeaders(SPRequest& request) { + request.clearHeader("Shib-Session-ID", "HTTP_SHIB_SESSION_ID"); + request.clearHeader("Shib-Identity-Provider", "HTTP_SHIB_IDENTITY_PROVIDER"); + request.clearHeader("Shib-Authentication-Method", "HTTP_SHIB_AUTHENTICATION_METHOD"); + request.clearHeader("Shib-Authentication-Instant", "HTTP_SHIB_AUTHENTICATION_INSTANT"); + request.clearHeader("Shib-AuthnContext-Class", "HTTP_SHIB_AUTHNCONTEXT_CLASS"); + request.clearHeader("Shib-AuthnContext-Decl", "HTTP_SHIB_AUTHNCONTEXT_DECL"); + request.clearHeader("Shib-Assertion-Count", "HTTP_SHIB_ASSERTION_COUNT"); + request.clearHeader("REMOTE_USER", "HTTP_REMOTE_USER"); + //request.clearHeader("Shib-Application-ID"); handle inside app method + request.getApplication().clearAttributeHeaders(request); + } +}; + +void SHIBSP_API shibsp::registerServiceProviders() +{ + SPConfig::getConfig().ServiceProviderManager.registerFactory(XML_SERVICE_PROVIDER, XMLServiceProviderFactory); +} + +pair ServiceProvider::doAuthentication(SPRequest& request, bool handler) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("doAuthentication"); +#endif + Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider"); + + const Application* app=NULL; + string targetURL = request.getRequestURL(); + + try { + RequestMapper::Settings settings = request.getRequestSettings(); + app = &(request.getApplication()); + + // If not SSL, check to see if we should block or redirect it. + if (!request.isSecure()) { + pair redirectToSSL = settings.first->getString("redirectToSSL"); + if (redirectToSSL.first) { +#ifdef HAVE_STRCASECMP + if (!strcasecmp("GET",request.getMethod()) || !strcasecmp("HEAD",request.getMethod())) { +#else + if (!stricmp("GET",request.getMethod()) || !stricmp("HEAD",request.getMethod())) { +#endif + // Compute the new target URL + string redirectURL = string("https://") + request.getHostname(); + if (strcmp(redirectToSSL.second,"443")) { + redirectURL = redirectURL + ':' + redirectToSSL.second; + } + redirectURL += request.getRequestURI(); + return make_pair(true, request.sendRedirect(redirectURL.c_str())); + } + else { + TemplateParameters tp; + tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?')); + return make_pair(true,sendError(log, request, app, "ssl", tp, false)); + } + } + } + + const char* handlerURL=request.getHandlerURL(targetURL.c_str()); + if (!handlerURL) + throw ConfigurationException("Cannot determine handler from resource URL, check configuration."); + + // If the request URL contains the handler base URL for this application, either dispatch + // directly (mainly Apache 2.0) or just pass back control. + if (strstr(targetURL.c_str(),handlerURL)) { + if (handler) + return doHandler(request); + else + return make_pair(true, request.returnOK()); + } + + // Three settings dictate how to proceed. + pair authType = settings.first->getString("authType"); + pair requireSession = settings.first->getBool("requireSession"); + pair requireSessionWith = settings.first->getString("requireSessionWith"); + + // If no session is required AND the AuthType (an Apache-derived concept) isn't shibboleth, + // then we ignore this request and consider it unprotected. Apache might lie to us if + // ShibBasicHijack is on, but that's up to it. + if ((!requireSession.first || !requireSession.second) && !requireSessionWith.first && +#ifdef HAVE_STRCASECMP + (!authType.first || strcasecmp(authType.second,"shibboleth"))) +#else + (!authType.first || _stricmp(authType.second,"shibboleth"))) +#endif + return make_pair(true,request.returnDecline()); + + // Fix for secadv 20050901 + clearHeaders(request); + + Session* session = NULL; + try { + session = request.getSession(); + } + catch (exception& e) { + log.warn("error during session lookup: %s", e.what()); + // If it's not a retryable session failure, we throw to the outer handler for reporting. + if (dynamic_cast(&e)==NULL) + throw; + } + + if (!session) { + // No session. Maybe that's acceptable? + if ((!requireSession.first || !requireSession.second) && !requireSessionWith.first) + return make_pair(true,request.returnOK()); + + // No session, but we require one. Initiate a new session using the indicated method. + const Handler* initiator=NULL; + if (requireSessionWith.first) { + initiator=app->getSessionInitiatorById(requireSessionWith.second); + if (!initiator) { + throw ConfigurationException( + "No session initiator found with id ($1), check requireSessionWith command.", params(1,requireSessionWith.second) + ); + } + } + else { + initiator=app->getDefaultSessionInitiator(); + if (!initiator) + throw ConfigurationException("No default session initiator found, check configuration."); + } + + return initiator->run(request,false); + } + + // We're done. Everything is okay. Nothing to report. Nothing to do.. + // Let the caller decide how to proceed. + log.debug("doAuthentication succeeded"); + return make_pair(false,0L); + } + catch (exception& e) { + TemplateParameters tp(&e); + tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?')); + return make_pair(true,sendError(log, request, app, "session", tp)); + } +} + +pair ServiceProvider::doAuthorization(SPRequest& request) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("doAuthorization"); +#endif + Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider"); + + const Application* app=NULL; + string targetURL = request.getRequestURL(); + + try { + RequestMapper::Settings settings = request.getRequestSettings(); + app = &(request.getApplication()); + + // Three settings dictate how to proceed. + pair authType = settings.first->getString("authType"); + pair requireSession = settings.first->getBool("requireSession"); + pair requireSessionWith = settings.first->getString("requireSessionWith"); + + // If no session is required AND the AuthType (an Apache-derived concept) isn't shibboleth, + // then we ignore this request and consider it unprotected. Apache might lie to us if + // ShibBasicHijack is on, but that's up to it. + if ((!requireSession.first || !requireSession.second) && !requireSessionWith.first && +#ifdef HAVE_STRCASECMP + (!authType.first || strcasecmp(authType.second,"shibboleth"))) +#else + (!authType.first || _stricmp(authType.second,"shibboleth"))) +#endif + return make_pair(true,request.returnDecline()); + + // Do we have an access control plugin? + if (settings.second) { + const Session* session = NULL; + try { + session = request.getSession(false); + } + catch (exception& e) { + log.warn("unable to obtain session to pass to access control provider: %s", e.what()); + } + + Locker acllock(settings.second); + switch (settings.second->authorized(request,session)) { + case AccessControl::shib_acl_true: + log.debug("access control provider granted access"); + return make_pair(true,request.returnOK()); + + case AccessControl::shib_acl_false: + { + log.warn("access control provider denied access"); + TemplateParameters tp; + tp.m_map["requestURL"] = targetURL; + return make_pair(true,sendError(log, request, app, "access", tp, false)); + } + + default: + // Use the "DECLINE" interface to signal we don't know what to do. + return make_pair(true,request.returnDecline()); + } + } + else { + return make_pair(true,request.returnDecline()); + } + } + catch (exception& e) { + TemplateParameters tp(&e); + tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?')); + return make_pair(true,sendError(log, request, app, "access", tp)); + } +} + +pair ServiceProvider::doExport(SPRequest& request, bool requireSession) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("doExport"); +#endif + Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider"); + + const Application* app=NULL; + string targetURL = request.getRequestURL(); + + try { + RequestMapper::Settings settings = request.getRequestSettings(); + app = &(request.getApplication()); + + const Session* session = NULL; + try { + session = request.getSession(false); + } + catch (exception& e) { + log.warn("unable to obtain session to export to request: %s", e.what()); + // If we have to have a session, then this is a fatal error. + if (requireSession) + throw; + } + + // Still no data? + if (!session) { + if (requireSession) + throw opensaml::RetryableProfileException("Unable to obtain session to export to request."); + else + return make_pair(false,0L); // just bail silently + } + + request.setHeader("Shib-Application-ID", app->getId()); + request.setHeader("Shib-Session-ID", session->getID()); + + // Export the IdP name and Authn method/context info. + const char* hval = session->getEntityID(); + if (hval) + request.setHeader("Shib-Identity-Provider", hval); + hval = session->getAuthnInstant(); + if (hval) + request.setHeader("Shib-Authentication-Instant", hval); + hval = session->getAuthnContextClassRef(); + if (hval) { + request.setHeader("Shib-Authentication-Method", hval); + request.setHeader("Shib-AuthnContext-Class", hval); + } + hval = session->getAuthnContextDeclRef(); + if (hval) + request.setHeader("Shib-AuthnContext-Decl", hval); + + // Maybe export the assertion keys. + pair exp=settings.first->getBool("exportAssertion"); + if (exp.first && exp.second) { + const PropertySet* sessions=app->getPropertySet("Sessions"); + pair exportLocation = sessions ? sessions->getString("exportLocation") : pair(false,NULL); + if (!exportLocation.first) + log.warn("can't export assertions without an exportLocation Sessions property"); + else { + const URLEncoder* encoder = XMLToolingConfig::getConfig().getURLEncoder(); + string exportName = "Shib-Assertion-00"; + string baseURL; + if (!strncmp(exportLocation.second, "http", 4)) + baseURL = exportLocation.second; + else + baseURL = string(request.getHandlerURL(targetURL.c_str())) + exportLocation.second; + baseURL = baseURL + "?key=" + session->getID() + "&ID="; + const vector& tokens = session->getAssertionIDs(); + vector::size_type count = 0; + for (vector::const_iterator tokenids = tokens.begin(); tokenids!=tokens.end(); ++tokenids) { + count++; + *(exportName.rbegin()) = '0' + (count%10); + *(++exportName.rbegin()) = '0' + (count/10); + string fullURL = baseURL + encoder->encode(*tokenids); + request.setHeader(exportName.c_str(), fullURL.c_str()); + } + request.setHeader("Shib-Assertion-Count", exportName.c_str() + 15); + } + } + + // Export the attributes. + const multimap& attributes = session->getIndexedAttributes(); + for (multimap::const_iterator a = attributes.begin(); a!=attributes.end(); ++a) { + string header(request.getSecureHeader(a->first.c_str())); + const vector& vals = a->second->getSerializedValues(); + for (vector::const_iterator v = vals.begin(); v!=vals.end(); ++v) { + if (!header.empty()) + header += ";"; + string::size_type pos = v->find_first_of(';',string::size_type(0)); + if (pos!=string::npos) { + string value(*v); + for (; pos != string::npos; pos = value.find_first_of(';',pos)) { + value.insert(pos, "\\"); + pos += 2; + } + header += value; + } + else { + header += (*v); + } + } + request.setHeader(a->first.c_str(), header.c_str()); + } + + // Check for REMOTE_USER. + bool remoteUserSet = false; + const vector& rmids = app->getRemoteUserAttributeIds(); + for (vector::const_iterator rmid = rmids.begin(); !remoteUserSet && rmid != rmids.end(); ++rmid) { + pair::const_iterator,multimap::const_iterator> matches = + attributes.equal_range(*rmid); + while (matches.first != matches.second) { + const vector& vals = matches.first->second->getSerializedValues(); + if (!vals.empty()) { + request.setRemoteUser(vals.front().c_str()); + remoteUserSet = true; + break; + } + } + } + + return make_pair(false,0L); + } + catch (exception& e) { + TemplateParameters tp(&e); + tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?')); + return make_pair(true,sendError(log, request, app, "session", tp)); + } +} + +pair ServiceProvider::doHandler(SPRequest& request) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("doHandler"); +#endif + Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider"); + + const Application* app=NULL; + string targetURL = request.getRequestURL(); + + try { + RequestMapper::Settings settings = request.getRequestSettings(); + app = &(request.getApplication()); + + // If not SSL, check to see if we should block or redirect it. + if (!request.isSecure()) { + pair redirectToSSL = settings.first->getString("redirectToSSL"); + if (redirectToSSL.first) { +#ifdef HAVE_STRCASECMP + if (!strcasecmp("GET",request.getMethod()) || !strcasecmp("HEAD",request.getMethod())) { +#else + if (!stricmp("GET",request.getMethod()) || !stricmp("HEAD",request.getMethod())) { +#endif + // Compute the new target URL + string redirectURL = string("https://") + request.getHostname(); + if (strcmp(redirectToSSL.second,"443")) { + redirectURL = redirectURL + ':' + redirectToSSL.second; + } + redirectURL += request.getRequestURI(); + return make_pair(true, request.sendRedirect(redirectURL.c_str())); + } + else { + TemplateParameters tp; + tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?')); + return make_pair(true,sendError(log, request, app, "ssl", tp, false)); + } + } + } + + const char* handlerURL=request.getHandlerURL(targetURL.c_str()); + if (!handlerURL) + throw ConfigurationException("Cannot determine handler from resource URL, check configuration."); + + // Make sure we only process handler requests. + if (!strstr(targetURL.c_str(),handlerURL)) + return make_pair(true, request.returnDecline()); + + const PropertySet* sessionProps=app->getPropertySet("Sessions"); + if (!sessionProps) + throw ConfigurationException("Unable to map request to application session settings, check configuration."); + + // Process incoming request. + pair handlerSSL=sessionProps->getBool("handlerSSL"); + + // Make sure this is SSL, if it should be + if ((!handlerSSL.first || handlerSSL.second) && !request.isSecure()) + throw opensaml::FatalProfileException("Blocked non-SSL access to Shibboleth handler."); + + // We dispatch based on our path info. We know the request URL begins with or equals the handler URL, + // so the path info is the next character (or null). + const Handler* handler=app->getHandler(targetURL.c_str() + strlen(handlerURL)); + if (!handler) + throw ConfigurationException("Shibboleth handler invoked at an unconfigured location."); + + pair hret=handler->run(request); + + // Did the handler run successfully? + if (hret.first) + return hret; + + throw ConfigurationException("Configured Shibboleth handler failed to process the request."); + } + catch (exception& e) { + TemplateParameters tp(&e); + tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?')); + tp.m_request = &request; + return make_pair(true,sendError(log, request, app, "session", tp)); + } +} diff --git a/shibsp/ServiceProvider.h b/shibsp/ServiceProvider.h new file mode 100644 index 0000000..9ef1dae --- /dev/null +++ b/shibsp/ServiceProvider.h @@ -0,0 +1,201 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/ServiceProvider.h + * + * Interface to a Shibboleth ServiceProvider instance. + */ + +#ifndef __shibsp_sp_h__ +#define __shibsp_sp_h__ + +#include +#ifndef SHIBSP_LITE +# include +# include +# include +#endif +#include + +namespace shibsp { + + class SHIBSP_API Application; + class SHIBSP_API Handler; + class SHIBSP_API ListenerService; + class SHIBSP_API RequestMapper; + class SHIBSP_API SessionCache; + class SHIBSP_API SPRequest; + class SHIBSP_API TemplateParameters; +#ifndef SHIBSP_LITE + class SHIBSP_API TransactionLog; +#endif + + /** + * Interface to a Shibboleth ServiceProvider instance. + * + *

A ServiceProvider exposes configuration and infrastructure services required + * by the SP implementation, allowing a flexible configuration format. + */ + class SHIBSP_API ServiceProvider : public virtual xmltooling::Lockable, public virtual PropertySet + { + MAKE_NONCOPYABLE(ServiceProvider); + protected: + ServiceProvider() {} + public: + virtual ~ServiceProvider() {} + + /** + * Loads a configuration and prepares the instance for use. + * + *

Implemented as a separate method so that services can rely on + * other services while they initialize by accessing the ServiceProvider + * from the SPConfig singleton. + */ + virtual void init()=0; + +#ifndef SHIBSP_LITE + /** + * Returns a TransactionLog instance. + * + * @return a TransactionLog instance + */ + virtual TransactionLog* getTransactionLog() const=0; + + /** + * Returns a StorageService instance based on an ID. + * + * @param id a NULL-terminated key identifying the StorageService to the configuration + * @return a StorageService if available, or NULL + */ + virtual xmltooling::StorageService* getStorageService(const char* id) const=0; +#endif + + /** + * Returns a SessionCache instance. + * + * @param required true iff an exception should be thrown if no SessionCache is available + * @return a SessionCache + */ + virtual SessionCache* getSessionCache(bool required=true) const=0; + + /** + * Returns a ListenerService instance. + * + * @param required true iff an exception should be thrown if no ListenerService is available + * @return a ListenerService + */ + virtual ListenerService* getListenerService(bool required=true) const=0; + +#ifndef SHIBSP_LITE + /** + * Returns the security policy settings for an identified policy. + * + * @param id identifies the policy to return + * @return a PropertySet + */ + virtual const PropertySet* getPolicySettings(const char* id) const=0; + + /** + * Returns the security policy rules for an identified policy. + * + * @param id identifies the policy to return + * @return an array of policy rules + */ + virtual const std::vector& getPolicyRules(const char* id) const=0; + + /** + * Sets implementation-specific transport options. + * + * @param transport a SOAPTransport object + * @return true iff all options were successfully set + */ + virtual bool setTransportOptions(xmltooling::SOAPTransport& transport) const=0; +#endif + + /** + * Returns a RequestMapper instance. + * + * @param required true iff an exception should be thrown if no RequestMapper is available + * @return a RequestMapper + */ + virtual RequestMapper* getRequestMapper(bool required=true) const=0; + + /** + * Returns an Application instance matching the specified ID. + * + * @param applicationId the ID of the application + * @return pointer to the application, or NULL + */ + virtual const Application* getApplication(const char* applicationId) const=0; + + /** + * Enforces requirements for an authenticated session. + * + *

If the return value's first member is true, then request processing should terminate + * with the second member as a status value. If false, processing can continue. + * + * @param request SP request interface + * @param handler true iff a request to a registered Handler location can be directly executed + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + virtual std::pair doAuthentication(SPRequest& request, bool handler=false) const; + + /** + * Enforces authorization requirements based on the authenticated session. + * + *

If the return value's first member is true, then request processing should terminate + * with the second member as a status value. If false, processing can continue. + * + * @param request SP request interface + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + virtual std::pair doAuthorization(SPRequest& request) const; + + /** + * Publishes session contents to the request in the form of headers or environment variables. + * + *

If the return value's first member is true, then request processing should terminate + * with the second member as a status value. If false, processing can continue. + * + * @param request SP request interface + * @param requireSession set to true iff an error should result if no session exists + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + virtual std::pair doExport(SPRequest& request, bool requireSession=true) const; + + /** + * Services requests for registered Handler locations. + * + *

If the return value's first member is true, then request processing should terminate + * with the second member as a status value. If false, processing can continue. + * + * @param request SP request interface + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + virtual std::pair doHandler(SPRequest& request) const; + }; + + /** + * Registers ServiceProvider classes into the runtime. + */ + void SHIBSP_API registerServiceProviders(); + + /** SP based on integrated XML and native server configuration. */ + #define XML_SERVICE_PROVIDER "XML" +}; + +#endif /* __shibsp_sp_h__ */ diff --git a/shibsp/SessionCache.h b/shibsp/SessionCache.h new file mode 100644 index 0000000..18910bd --- /dev/null +++ b/shibsp/SessionCache.h @@ -0,0 +1,315 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/SessionCache.h + * + * Caches and manages user sessions + */ + +#ifndef __shibsp_sessioncache_h__ +#define __shibsp_sessioncache_h__ + +#include +#ifndef SHIBSP_LITE +# include +# include +#endif +#include +#include +#include + +namespace shibsp { + + class SHIBSP_API Application; + class SHIBSP_API Attribute; + + /** + * Encapsulates access to a user's security session. + * + *

The SessionCache does not itself require locking to manage + * concurrency, but access to each Session is generally exclusive + * or at least controlled, and the caller must unlock a Session + * to dispose of it. + */ + class SHIBSP_API Session : public virtual xmltooling::Lockable + { + MAKE_NONCOPYABLE(Session); + protected: + Session() {} + virtual ~Session() {} + public: + /** + * Returns the session key. + * + * @return unique ID of session + */ + virtual const char* getID() const=0; + + /** + * Returns the session's application ID. + * + * @return unique ID of application bound to session + */ + virtual const char* getApplicationID() const=0; + + /** + * Returns the session expiration. + * + * @return the session's expiration time or 0 for none + */ + virtual time_t getExpiration() const=0; + + /** + * Returns the last access time of the session. + * + * @return the session's last access time + */ + virtual time_t getLastAccess() const=0; + + /** + * Returns the address of the client associated with the session. + * + * @return the client's network address + */ + virtual const char* getClientAddress() const=0; + + /** + * Returns the entityID of the IdP that initiated the session. + * + * @return the IdP's entityID + */ + virtual const char* getEntityID() const=0; + + /** + * Returns the protocol family used to initiate the session. + * + * @return the protocol constant that represents the general SSO protocol used + */ + virtual const char* getProtocol() const=0; + + /** + * Returns the UTC timestamp on the authentication event at the IdP. + * + * @return the UTC authentication timestamp + */ + virtual const char* getAuthnInstant() const=0; + +#ifndef SHIBSP_LITE + /** + * Returns the NameID associated with a session. + * + *

SAML 1.x identifiers will be promoted to the 2.0 type. + * + * @return a SAML 2.0 NameID associated with the session, if any + */ + virtual const opensaml::saml2::NameID* getNameID() const=0; +#endif + + /** + * Returns the SessionIndex provided with the session. + * + * @return the SessionIndex from the original SSO assertion, if any + */ + virtual const char* getSessionIndex() const=0; + + /** + * Returns a URI containing an AuthnContextClassRef provided with the session. + * + *

SAML 1.x AuthenticationMethods will be returned as class references. + * + * @return a URI identifying the authentication context class + */ + virtual const char* getAuthnContextClassRef() const=0; + + /** + * Returns a URI containing an AuthnContextDeclRef provided with the session. + * + * @return a URI identifying the authentication context declaration + */ + virtual const char* getAuthnContextDeclRef() const=0; + + /** + * Returns the resolved attributes associated with the session. + * + * @return an immutable array of attributes + */ + virtual const std::vector& getAttributes() const=0; + + /** + * Returns the resolved attributes associated with the session, indexed by ID + * + * @return an immutable map of attributes keyed by attribute ID + */ + virtual const std::multimap& getIndexedAttributes() const=0; + + /** + * Returns the identifiers of the assertion(s) cached by the session. + * + *

The SSO assertion is guaranteed to be first in the set. + * + * @return an immutable array of AssertionID values + */ + virtual const std::vector& getAssertionIDs() const=0; + +#ifndef SHIBSP_LITE + /** + * Adds additional attributes to the session. + * + * @param attributes reference to an array of Attributes to cache (will be freed by cache) + */ + virtual void addAttributes(const std::vector& attributes)=0; + + /** + * Returns an assertion cached by the session. + * + * @param id identifier of the assertion to retrieve + * @return pointer to assertion, or NULL + */ + virtual const opensaml::Assertion* getAssertion(const char* id) const=0; + + /** + * Stores an assertion in the session. + * + * @param assertion pointer to an assertion to cache (will be freed by cache) + */ + virtual void addAssertion(opensaml::Assertion* assertion)=0; +#endif + }; + + /** + * Creates and manages user sessions + * + * The cache abstracts a persistent (meaning across requests) cache of + * instances of the Session interface. Creation of new entries and entry + * lookup are confined to this interface to enable the implementation to + * remote and/or optimize calls by implementing custom versions of the + * Session interface as required. + */ + class SHIBSP_API SessionCache + { + MAKE_NONCOPYABLE(SessionCache); + protected: + SessionCache() {} + public: + virtual ~SessionCache() {} + +#ifndef SHIBSP_LITE + /** + * Inserts a new session into the cache and binds the session to the outgoing + * client response. + * + *

The SSO tokens and Attributes remain owned by the caller and are copied by the cache. + * + * @param application reference to Application that owns the Session + * @param httpRequest request that initiated session + * @param httpResponse current response to client + * @param expires expiration time of session + * @param issuer issuing metadata of assertion issuer, if known + * @param protocol protocol family used to initiate the session + * @param nameid principal identifier, normalized to SAML 2, if any + * @param authn_instant UTC timestamp of authentication at IdP, if known + * @param session_index index of session between principal and IdP, if any + * @param authncontext_class method/category of authentication event, if known + * @param authncontext_decl specifics of authentication event, if known + * @param tokens assertions to cache with session, if any + * @param attributes optional array of resolved Attributes to cache with session + */ + virtual void insert( + const Application& application, + const xmltooling::HTTPRequest& httpRequest, + xmltooling::HTTPResponse& httpResponse, + time_t expires, + const opensaml::saml2md::EntityDescriptor* issuer=NULL, + const XMLCh* protocol=NULL, + const opensaml::saml2::NameID* nameid=NULL, + const XMLCh* authn_instant=NULL, + const XMLCh* session_index=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL, + const std::vector* tokens=NULL, + const std::vector* attributes=NULL + )=0; + + /** + * Determines whether the Session bound to a client request matches a set of input criteria. + * + * @param application reference to Application that owns the Session + * @param request request in which to locate Session + * @param issuer required source of session(s) + * @param nameid required name identifier + * @param indexes session indexes + * @return true iff the Session exists and matches the input criteria + */ + virtual bool matches( + const Application& application, + const xmltooling::HTTPRequest& request, + const opensaml::saml2md::EntityDescriptor* issuer, + const opensaml::saml2::NameID& nameid, + const std::set* indexes + )=0; + + /** + * Executes a test of the cache's general health. + */ + virtual void test()=0; +#endif + + /** + * Returns the ID of the session bound to the specified client request, if possible. + * + * @param application reference to Application that owns the Session + * @param request request from client containing session, or a reference to it + * @return ID of session, if any known, or an empty string + */ + virtual std::string active(const Application& application, const xmltooling::HTTPRequest& request)=0; + + /** + * Locates an existing session bound to a request. + * + *

If the client address is supplied, then a check will be performed against + * the address recorded in the record. + * + * @param application reference to Application that owns the Session + * @param request request from client containing session, or a reference to it + * @param client_addr network address of client (if known) + * @param timeout inactivity timeout to enforce (0 for none, NULL to bypass check/update of last access) + * @return pointer to locked Session, or NULL + */ + virtual Session* find( + const Application& application, const xmltooling::HTTPRequest& request, const char* client_addr=NULL, time_t* timeout=NULL + )=0; + + /** + * Deletes an existing session bound to a request. + * + * @param application reference to Application that owns the Session + * @param request request from client containing session, or a reference to it + * @param response optional response to client enabling removal of session or reference + */ + virtual void remove(const Application& application, const xmltooling::HTTPRequest& request, xmltooling::HTTPResponse* response=NULL)=0; + }; + + /** SessionCache implementation backed by a StorageService. */ + #define STORAGESERVICE_SESSION_CACHE "StorageService" + + /** + * Registers SessionCache classes into the runtime. + */ + void SHIBSP_API registerSessionCaches(); +}; + +#endif /* __shibsp_sessioncache_h__ */ diff --git a/shibsp/SessionCacheEx.h b/shibsp/SessionCacheEx.h new file mode 100644 index 0000000..b71f568 --- /dev/null +++ b/shibsp/SessionCacheEx.h @@ -0,0 +1,92 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/SessionCacheEx.h + * + * Extended SessionCache API with additional capabilities + */ + +#ifndef __shibsp_sessioncacheex_h__ +#define __shibsp_sessioncacheex_h__ + +#include + +namespace shibsp { + + /** + * Extended SessionCache API with additional capabilities + */ + class SHIBSP_API SessionCacheEx : public SessionCache + { + protected: + SessionCacheEx() {} + public: + virtual ~SessionCacheEx() {} + +#ifndef SHIBSP_LITE + /** + * Returns active sessions that match particular parameters and records the logout + * to prevent race conditions. + * + *

On exit, the mapping between these sessions and the associated information MAY be + * removed by the cache, so subsequent calls to this method may not return anything. + * + *

Until logout expiration, any attempt to create a session with the same parameters + * will be blocked by the cache. + * + * @param application reference to Application that owns the session(s) + * @param issuer source of session(s) + * @param nameid name identifier associated with the session(s) to terminate + * @param indexes indexes of sessions, or NULL for all sessions associated with other parameters + * @param expires logout expiration + * @param sessions on exit, contains the IDs of the matching sessions found + */ + virtual std::vector::size_type logout( + const Application& application, + const opensaml::saml2md::EntityDescriptor* issuer, + const opensaml::saml2::NameID& nameid, + const std::set* indexes, + time_t expires, + std::vector& sessions + )=0; +#endif + + /** + * Locates an existing session by ID. + * + *

If the client address is supplied, then a check will be performed against + * the address recorded in the record. + * + * @param application reference to Application that owns the Session + * @param key session key + * @param client_addr network address of client (if known) + * @param timeout inactivity timeout to enforce (0 for none, NULL to bypass check/update of last access) + * @return pointer to locked Session, or NULL + */ + virtual Session* find(const Application& application, const char* key, const char* client_addr=NULL, time_t* timeout=NULL)=0; + + /** + * Deletes an existing session. + * + * @param application reference to Application that owns the Session + * @param key session key + */ + virtual void remove(const Application& application, const char* key)=0; + }; +}; + +#endif /* __shibsp_sessioncacheex_h__ */ diff --git a/shibsp/TransactionLog.h b/shibsp/TransactionLog.h new file mode 100644 index 0000000..64ba2bc --- /dev/null +++ b/shibsp/TransactionLog.h @@ -0,0 +1,67 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/TransactionLog.h + * + * Interface to a synchronized logging object. + */ + +#ifndef __shibsp_txlog_h__ +#define __shibsp_txlog_h__ + +#include +#include +#include +#include + +namespace shibsp { + + /** + * Interface to a synchronized logging object. + * + *

This is platform/logging specific, but we can at least hide the details here. + */ + class SHIBSP_API TransactionLog : public virtual xmltooling::Lockable + { + MAKE_NONCOPYABLE(TransactionLog); + public: + TransactionLog() + : log(xmltooling::logging::Category::getInstance(SHIBSP_TX_LOGCAT)), m_lock(xmltooling::Mutex::create()) { + } + + virtual ~TransactionLog() { + delete m_lock; + } + + xmltooling::Lockable* lock() { + m_lock->lock(); + return this; + } + + void unlock() { + m_lock->unlock(); + } + + /** Logging object. */ + xmltooling::logging::Category& log; + + private: + xmltooling::Mutex* m_lock; + }; +}; + +#endif /* __shibsp_txlog_h__ */ diff --git a/shibsp/attribute/Attribute.cpp b/shibsp/attribute/Attribute.cpp new file mode 100644 index 0000000..a943272 --- /dev/null +++ b/shibsp/attribute/Attribute.cpp @@ -0,0 +1,105 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * shibsp/attribute/Attribute.cpp + * + * A resolved attribute. + */ + +#include "internal.h" +#include "SPConfig.h" +#ifndef SHIBSP_LITE +# include "attribute/AttributeDecoder.h" +#endif +#include "attribute/SimpleAttribute.h" +#include "attribute/ScopedAttribute.h" +#include "attribute/NameIDAttribute.h" +#include "util/SPConstants.h" + +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + SHIBSP_DLLLOCAL Attribute* SimpleAttributeFactory(DDF& in) { + return new SimpleAttribute(in); + } + + SHIBSP_DLLLOCAL Attribute* ScopedAttributeFactory(DDF& in) { + return new ScopedAttribute(in); + } + + SHIBSP_DLLLOCAL Attribute* NameIDAttributeFactory(DDF& in) { + return new NameIDAttribute(in); + } + +#ifndef SHIBSP_LITE + SHIBSP_DLLLOCAL PluginManager::Factory StringAttributeDecoderFactory; + SHIBSP_DLLLOCAL PluginManager::Factory ScopedAttributeDecoderFactory; + SHIBSP_DLLLOCAL PluginManager::Factory NameIDAttributeDecoderFactory; + + static const XMLCh _StringAttributeDecoder[] = UNICODE_LITERAL_22(S,t,r,i,n,g,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r); + static const XMLCh _ScopedAttributeDecoder[] = UNICODE_LITERAL_22(S,c,o,p,e,d,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r); + static const XMLCh _NameIDAttributeDecoder[] = UNICODE_LITERAL_22(N,a,m,e,I,D,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r); + + static const XMLCh caseSensitive[] = UNICODE_LITERAL_13(c,a,s,e,S,e,n,s,i,t,i,v,e); +#endif +}; + +#ifndef SHIBSP_LITE +QName shibsp::StringAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _StringAttributeDecoder); +QName shibsp::ScopedAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _ScopedAttributeDecoder); +QName shibsp::NameIDAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _NameIDAttributeDecoder); + +void shibsp::registerAttributeDecoders() +{ + SPConfig& conf = SPConfig::getConfig(); + conf.AttributeDecoderManager.registerFactory(StringAttributeDecoderType, StringAttributeDecoderFactory); + conf.AttributeDecoderManager.registerFactory(ScopedAttributeDecoderType, ScopedAttributeDecoderFactory); + conf.AttributeDecoderManager.registerFactory(NameIDAttributeDecoderType, NameIDAttributeDecoderFactory); +} + +AttributeDecoder::AttributeDecoder(const DOMElement *e) : m_caseSensitive(true) +{ + if (e) { + const XMLCh* flag = e->getAttributeNS(NULL,caseSensitive); + if (flag && (*flag == chLatin_f || *flag == chDigit_0)) + m_caseSensitive = false; + } +} +#endif + +void shibsp::registerAttributeFactories() +{ + Attribute::registerFactory("", SimpleAttributeFactory); + Attribute::registerFactory("Simple", SimpleAttributeFactory); + Attribute::registerFactory("Scoped", ScopedAttributeFactory); + Attribute::registerFactory("NameID", NameIDAttributeFactory); +} + +std::map Attribute::m_factoryMap; + +Attribute* Attribute::unmarshall(DDF& in) +{ + map::const_iterator i = m_factoryMap.find(in.name() ? in.name() : ""); + if (i == m_factoryMap.end()) + throw AttributeException("No registered factory for Attribute of type ($1).", xmltooling::params(1,in.name())); + return (i->second)(in); +} diff --git a/shibsp/attribute/Attribute.h b/shibsp/attribute/Attribute.h new file mode 100644 index 0000000..1219681 --- /dev/null +++ b/shibsp/attribute/Attribute.h @@ -0,0 +1,275 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/Attribute.h + * + * A resolved attribute. + */ + +#ifndef __shibsp_attribute_h__ +#define __shibsp_attribute_h__ + +#include +#include + +#include +#include +#include + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + + /** + * A resolved attribute. + * + *

Resolved attributes are a neutral construct that represent both simple and + * complex attribute data structures that might be found in SAML assertions + * or obtained from other sources. + * + *

Attributes consist of an id/name that is locally unique (that is, unique to a + * configuration at any given point in time) and zero or more values. Values can + * be of any type or structure, but will generally be made available to applications + * only if a serialized string form exists. More complex values can be used with + * access control plugins that understand them, however. + */ + class SHIBSP_API Attribute + { + MAKE_NONCOPYABLE(Attribute); + protected: + /** + * Constructor + * + * @param ids array with primary identifier in first position, followed by any aliases + */ + Attribute(const std::vector& ids) : m_id(ids), m_caseSensitive(true) { + } + + /** + * Constructs based on a remoted Attribute. + * + *

This allows Attribute objects to be recreated after marshalling. + * The DDF supplied must be a struct containing a single list member named + * with the Attribute's "id" and containing the values. + * + * @param in input object containing marshalled Attribute + */ + Attribute(DDF& in) : m_caseSensitive(in["case_insensitive"].isnull()) { + const char* id = in.first().name(); + if (id && *id) + m_id.push_back(id); + else + throw AttributeException("No id found in marshalled attribute content."); + DDF aliases = in["aliases"]; + if (aliases.islist()) { + DDF alias = aliases.first(); + while (alias.isstring()) { + m_id.push_back(alias.string()); + alias = aliases.next(); + } + } + } + + /** + * Maintains a copy of serialized attribute values, when possible. + * + *

Implementations should maintain the array when values are added or removed. + */ + mutable std::vector m_serialized; + + public: + virtual ~Attribute() {} + + /** + * Returns the Attribute identifier. + * + * @return the Attribute identifier + */ + const char* getId() const { + return m_id.front().c_str(); + } + + /** + * Returns all of the effective names for the Attribute. + * + * @return immutable array of identifiers, with the primary ID in the first position + */ + const std::vector& getAliases() const { + return m_id; + } + + /** + * Returns all of the effective names for the Attribute. + * + * @return mutable array of identifiers, with the primary ID in the first position + */ + std::vector& getAliases() { + return m_id; + } + + /** + * Sets whether case sensitivity should apply to basic value comparisons. + * + * @param caseSensitive true iff value comparisons should be case sensitive + */ + void setCaseSensitive(bool caseSensitive) { + m_caseSensitive = caseSensitive; + } + + /** + * Indicates whether case sensitivity should apply to basic value comparisons. + * + * @return true iff value comparisons should be case sensitive + */ + bool isCaseSensitive() const { + return m_caseSensitive; + } + + /** + * Returns the number of values. + * + * @return number of values + */ + virtual size_t valueCount() const { + return m_serialized.size(); + } + + /** + * Returns serialized Attribute values encoded as UTF-8 strings. + * + * @return an immutable vector of values + */ + virtual const std::vector& getSerializedValues() const { + return m_serialized; + } + + /** + * Informs the Attribute that values have changed and any serializations + * must be cleared. + */ + virtual void clearSerializedValues()=0; + + /** + * Gets the string equivalent of the value at the specified position (starting from zero). + * + * @param index position of value + * @return the specified value in its "string" form, or NULL if undefined + */ + virtual const char* getString(size_t index) const { + return m_serialized[index].c_str(); + } + + /** + * Gets the "scope" of the value at the specified position (starting from zero). + * + * @param index position of value + * @return the specified value's "scope", or NULL if attribute is unscoped + */ + virtual const char* getScope(size_t index) const { + return NULL; + } + + /** + * Removes the value at the specified position (starting from zero). + * + * @param index position of value to remove + */ + virtual void removeValue(size_t index) { + if (index < m_serialized.size()) + m_serialized.erase(m_serialized.begin() + index); + } + + /** + * Marshalls an Attribute for remoting. + * + *

This allows Attribute objects to be communicated across process boundaries + * without excess XML parsing. The DDF returned must be a struct containing + * a single list member named with the Attribute's "id". The name of the struct + * should contain the registered name of the Attribute implementation. + */ + virtual DDF marshall() const { + DDF ddf(NULL); + ddf.structure().addmember(m_id.front().c_str()).list(); + if (!m_caseSensitive) + ddf.addmember("case_insensitive"); + if (m_id.size() > 1) { + DDF alias; + DDF aliases = ddf.addmember("aliases").list(); + for (std::vector::const_iterator a = m_id.begin() + 1; a != m_id.end(); ++a) { + alias = DDF(NULL).string(a->c_str()); + aliases.add(alias); + } + } + return ddf; + } + + /** + * Unmarshalls a remoted Attribute. + * + * @param in remoted Attribute data + * @return a resolved Attribute of the proper subclass + */ + static Attribute* unmarshall(DDF& in); + + /** A function that unmarshalls remoted data into the proper Attribute subclass. */ + typedef Attribute* AttributeFactory(DDF& in); + + /** + * Registers an AttributeFactory function for a given attribute "type". + * + * @param type string used at the root of remoted Attribute structures + * @param factory factory function + */ + static void registerFactory(const char* type, AttributeFactory* factory) { + m_factoryMap[type] = factory; + } + + /** + * Deregisters an AttributeFactory function for a given attribute "type". + * + * @param type string used at the root of remoted Attribute structures + */ + static void deregisterFactory(const char* type) { + m_factoryMap.erase(type); + } + + /** + * Clears the map of factories. + */ + static void deregisterFactories() { + m_factoryMap.clear(); + } + + private: + static std::map m_factoryMap; + std::vector m_id; + bool m_caseSensitive; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + /** Registers built-in Attribute types into the runtime. */ + void registerAttributeFactories(); + +}; + +#endif /* __shibsp_attribute_h__ */ diff --git a/shibsp/attribute/AttributeDecoder.h b/shibsp/attribute/AttributeDecoder.h new file mode 100644 index 0000000..4d0fe94 --- /dev/null +++ b/shibsp/attribute/AttributeDecoder.h @@ -0,0 +1,82 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/AttributeDecoder.h + * + * Decodes SAML NameID/Attribute objects into resolved Attributes. + */ + +#ifndef __shibsp_attrdecoder_h__ +#define __shibsp_attrdecoder_h__ + +#include +#include + +namespace shibsp { + + /** + * Decodes XML objects into resolved Attributes. + */ + class SHIBSP_API AttributeDecoder + { + MAKE_NONCOPYABLE(AttributeDecoder); + protected: + /** + * Constructor. + * + * @param e root of DOM to configure the decoder + */ + AttributeDecoder(const xercesc::DOMElement* e); + + /** Flag for case sensitivity of decoded attributes. */ + bool m_caseSensitive; + + public: + virtual ~AttributeDecoder() {} + + /** + * Decodes an XMLObject into a resolved Attribute. + * + * @param ids array containing primary identifier in first position, followed by any aliases + * @param xmlObject XMLObject to decode + * @param assertingParty name of the party asserting the attribute + * @param relyingParty name of the party relying on the attribute + * @return a resolved Attribute, or NULL + */ + virtual Attribute* decode( + const std::vector& ids, + const xmltooling::XMLObject* xmlObject, + const char* assertingParty=NULL, + const char* relyingParty=NULL + ) const=0; + }; + + + /** Decodes into a SimpleAttribute. */ + extern SHIBSP_API xmltooling::QName StringAttributeDecoderType; + + /** Decodes into a ScopedAttribute. */ + extern SHIBSP_API xmltooling::QName ScopedAttributeDecoderType; + + /** Decodes into a NameIDAttribute. */ + extern SHIBSP_API xmltooling::QName NameIDAttributeDecoderType; + + /** Registers built-in AttributeDecoders into the runtime. */ + void registerAttributeDecoders(); +}; + +#endif /* __shibsp_attrdecoder_h__ */ diff --git a/shibsp/attribute/NameIDAttribute.h b/shibsp/attribute/NameIDAttribute.h new file mode 100644 index 0000000..bd292ce --- /dev/null +++ b/shibsp/attribute/NameIDAttribute.h @@ -0,0 +1,187 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/NameIDAttribute.h + * + * An Attribute whose values are relations of a value and a scope. + */ + +#ifndef __shibsp_nameidattr_h__ +#define __shibsp_nameidattr_h__ + +#include +#include + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + + /** Default serialization format for NameIDs */ + #define DEFAULT_NAMEID_FORMATTER "$Name!!$NameQualifier!!$SPNameQualifier" + + /** + * An Attribute whose values are derived from or mappable to a SAML NameID. + */ + class SHIBSP_API NameIDAttribute : public Attribute + { + public: + /** + * Constructor. + * + * @param ids array with primary identifier in first position, followed by any aliases + * @param formatter template for serialization of tuple + */ + NameIDAttribute(const std::vector& ids, const char* formatter=DEFAULT_NAMEID_FORMATTER) + : Attribute(ids), m_formatter(formatter) { + } + + /** + * Constructs based on a remoted NameIDAttribute. + * + * @param in input object containing marshalled NameIDAttribute + */ + NameIDAttribute(DDF& in) : Attribute(in) { + DDF val = in["_formatter"]; + if (val.isstring()) + m_formatter = val.string(); + else + m_formatter = DEFAULT_NAMEID_FORMATTER; + const char* pch; + val = in.first().first(); + while (val.name()) { + m_values.push_back(Value()); + Value& v = m_values.back(); + v.m_Name = val.name(); + pch = val["Format"].string(); + if (pch) + v.m_Format = pch; + pch = val["NameQualifier"].string(); + if (pch) + v.m_NameQualifier = pch; + pch = val["SPNameQualifier"].string(); + if (pch) + v.m_SPNameQualifier = pch; + pch = val["SPProvidedID"].string(); + if (pch) + v.m_SPProvidedID = pch; + val = in.first().next(); + } + } + + virtual ~NameIDAttribute() {} + + /** + * Holds all the fields associated with a NameID. + */ + struct SHIBSP_API Value + { + std::string m_Name; + std::string m_Format; + std::string m_NameQualifier; + std::string m_SPNameQualifier; + std::string m_SPProvidedID; + }; + + /** + * Returns the set of values encoded as UTF-8 strings. + * + *

Each compound value is a pair containing the simple value and the scope. + * + * @return a mutable vector of the values + */ + std::vector& getValues() { + return m_values; + } + + size_t valueCount() const { + return m_values.size(); + } + + void clearSerializedValues() { + m_serialized.clear(); + } + + const char* getString(size_t index) const { + return m_values[index].m_Name.c_str(); + } + + const char* getScope(size_t index) const { + return m_values[index].m_NameQualifier.c_str(); + } + + void removeValue(size_t index) { + Attribute::removeValue(index); + if (index < m_values.size()) + m_values.erase(m_values.begin() + index); + } + + const std::vector& getSerializedValues() const { + if (m_serialized.empty()) { + for (std::vector::const_iterator i=m_values.begin(); i!=m_values.end(); ++i) { + // This is kind of a hack, but it's a good way to reuse some code. + xmltooling::XMLToolingException e( + m_formatter, + xmltooling::namedparams( + 5, + "Name", i->m_Name.c_str(), + "Format", i->m_Format.c_str(), + "NameQualifier", i->m_NameQualifier.c_str(), + "SPNameQualifier", i->m_SPNameQualifier.c_str(), + "SPProvidedID", i->m_SPProvidedID.c_str() + ) + ); + m_serialized.push_back(e.what()); + } + } + return Attribute::getSerializedValues(); + } + + DDF marshall() const { + DDF ddf = Attribute::marshall(); + ddf.name("NameID"); + ddf.addmember("_formatter").string(m_formatter.c_str()); + DDF vlist = ddf.first(); + for (std::vector::const_iterator i=m_values.begin(); i!=m_values.end(); ++i) { + DDF val = DDF(i->m_Name.c_str()).structure(); + if (!i->m_Format.empty()) + val.addmember("Format").string(i->m_Format.c_str()); + if (!i->m_NameQualifier.empty()) + val.addmember("NameQualifier").string(i->m_NameQualifier.c_str()); + if (!i->m_SPNameQualifier.empty()) + val.addmember("SPNameQualifier").string(i->m_SPNameQualifier.c_str()); + if (!i->m_SPProvidedID.empty()) + val.addmember("SPProvidedID").string(i->m_SPProvidedID.c_str()); + vlist.add(val); + } + return ddf; + } + + private: + std::vector m_values; + std::string m_formatter; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_nameidattr_h__ */ diff --git a/shibsp/attribute/NameIDAttributeDecoder.cpp b/shibsp/attribute/NameIDAttributeDecoder.cpp new file mode 100644 index 0000000..4ed2cda --- /dev/null +++ b/shibsp/attribute/NameIDAttributeDecoder.cpp @@ -0,0 +1,228 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * NameIDAttributeDecoder.cpp + * + * Decodes SAML into NameIDAttributes + */ + +#include "internal.h" +#include "attribute/AttributeDecoder.h" +#include "attribute/NameIDAttribute.h" + +#include +#include + +using namespace shibsp; +using namespace opensaml::saml1; +using namespace opensaml::saml2; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + static XMLCh formatter[] = UNICODE_LITERAL_9(f,o,r,m,a,t,t,e,r); + + class SHIBSP_DLLLOCAL NameIDAttributeDecoder : virtual public AttributeDecoder + { + public: + NameIDAttributeDecoder(const DOMElement* e) : AttributeDecoder(e), m_formatter(e ? e->getAttributeNS(NULL,formatter) : NULL) {} + ~NameIDAttributeDecoder() {} + + shibsp::Attribute* decode( + const vector& ids, const XMLObject* xmlObject, const char* assertingParty=NULL, const char* relyingParty=NULL + ) const; + + private: + void extract( + const NameIDType* n, vector& dest, const char* assertingParty=NULL, const char* relyingParty=NULL + ) const; + void extract( + const NameIdentifier* n, vector& dest, const char* assertingParty=NULL, const char* relyingParty=NULL + ) const; + auto_ptr_char m_formatter; + }; + + AttributeDecoder* SHIBSP_DLLLOCAL NameIDAttributeDecoderFactory(const DOMElement* const & e) + { + return new NameIDAttributeDecoder(e); + } +}; + +shibsp::Attribute* NameIDAttributeDecoder::decode( + const vector& ids, const XMLObject* xmlObject, const char* assertingParty, const char* relyingParty + ) const +{ + auto_ptr nameid( + new NameIDAttribute(ids, (m_formatter.get() && *m_formatter.get()) ? m_formatter.get() : DEFAULT_NAMEID_FORMATTER) + ); + nameid->setCaseSensitive(m_caseSensitive); + vector& dest = nameid->getValues(); + vector::const_iterator v,stop; + + Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder"); + + if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) { + const opensaml::saml2::Attribute* saml2attr = dynamic_cast(xmlObject); + if (saml2attr) { + const vector& values = saml2attr->getAttributeValues(); + v = values.begin(); + stop = values.end(); + if (log.isDebugEnabled()) { + auto_ptr_char n(saml2attr->getName()); + log.debug( + "decoding NameIDAttribute (%s) from SAML 2 Attribute (%s) with %lu value(s)", + ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size() + ); + } + } + else { + const opensaml::saml1::Attribute* saml1attr = dynamic_cast(xmlObject); + if (saml1attr) { + const vector& values = saml1attr->getAttributeValues(); + v = values.begin(); + stop = values.end(); + if (log.isDebugEnabled()) { + auto_ptr_char n(saml1attr->getAttributeName()); + log.debug( + "decoding NameIDAttribute (%s) from SAML 1 Attribute (%s) with %lu value(s)", + ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size() + ); + } + } + else { + log.warn("XMLObject type not recognized by NameIDAttributeDecoder, no values returned"); + return NULL; + } + } + + for (; v!=stop; ++v) { + const NameIDType* n2 = dynamic_cast(*v); + if (n2) + extract(n2, dest); + else { + const NameIdentifier* n1=dynamic_cast(*v); + if (n1) + extract(n1, dest); + else if ((*v)->hasChildren()) { + const list& values = (*v)->getOrderedChildren(); + for (list::const_iterator vv = values.begin(); vv!=values.end(); ++vv) { + if (n2=dynamic_cast(*vv)) + extract(n2, dest); + else if (n1=dynamic_cast(*vv)) + extract(n1, dest); + else + log.warn("skipping AttributeValue without a recognizable NameID/NameIdentifier"); + } + } + } + } + + return dest.empty() ? NULL : nameid.release(); + } + + const NameIDType* saml2name = dynamic_cast(xmlObject); + if (saml2name) { + if (log.isDebugEnabled()) { + auto_ptr_char f(saml2name->getFormat()); + log.debug("decoding NameIDAttribute (%s) from SAML 2 NameID with Format (%s)", ids.front().c_str(), f.get() ? f.get() : "unspecified"); + } + extract(saml2name, dest); + } + else { + const NameIdentifier* saml1name = dynamic_cast(xmlObject); + if (saml1name) { + if (log.isDebugEnabled()) { + auto_ptr_char f(saml1name->getFormat()); + log.debug( + "decoding NameIDAttribute (%s) from SAML 1 NameIdentifier with Format (%s)", + ids.front().c_str(), f.get() ? f.get() : "unspecified" + ); + } + extract(saml1name, dest); + } + else { + log.warn("XMLObject type not recognized by NameIDAttributeDecoder, no values returned"); + return NULL; + } + } + + return dest.empty() ? NULL : nameid.release(); +} + +void NameIDAttributeDecoder::extract( + const NameIDType* n, vector& dest, const char* assertingParty, const char* relyingParty + ) const +{ + auto_arrayptr name(toUTF8(n->getName())); + if (name.get() && *name.get()) { + dest.push_back(NameIDAttribute::Value()); + NameIDAttribute::Value& val = dest.back(); + val.m_Name = name.get(); + char* str = toUTF8(n->getFormat()); + if (str) { + val.m_Format = str; + delete[] str; + } + + str = toUTF8(n->getNameQualifier()); + if (str && *str) + val.m_NameQualifier = str; + else if (assertingParty) + val.m_NameQualifier = assertingParty; + delete[] str; + + str = toUTF8(n->getSPNameQualifier()); + if (str && *str) + val.m_SPNameQualifier = str; + else if (relyingParty) + val.m_SPNameQualifier = relyingParty; + delete[] str; + + str = toUTF8(n->getSPProvidedID()); + if (str) { + val.m_SPProvidedID = str; + delete[] str; + } + } +} + +void NameIDAttributeDecoder::extract( + const NameIdentifier* n, vector& dest, const char* assertingParty, const char* relyingParty + ) const +{ + auto_arrayptr name(toUTF8(n->getName())); + if (name.get() && *name.get()) { + dest.push_back(NameIDAttribute::Value()); + NameIDAttribute::Value& val = dest.back(); + val.m_Name = name.get(); + char* str = toUTF8(n->getFormat()); + if (str) { + val.m_Format = str; + delete[] str; + } + + str = toUTF8(n->getNameQualifier()); + if (str && *str) + val.m_NameQualifier = str; + else if (assertingParty) + val.m_NameQualifier = assertingParty; + delete[] str; + + if (relyingParty) + val.m_SPNameQualifier = relyingParty; + } +} diff --git a/shibsp/attribute/ScopedAttribute.h b/shibsp/attribute/ScopedAttribute.h new file mode 100644 index 0000000..d72cd0c --- /dev/null +++ b/shibsp/attribute/ScopedAttribute.h @@ -0,0 +1,141 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/ScopedAttribute.h + * + * An Attribute whose values are relations of a value and a scope. + */ + +#ifndef __shibsp_scopedattr_h__ +#define __shibsp_scopedattr_h__ + +#include + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + + /** + * An Attribute whose values are relations of a value and a scope. + * + *

In practice, scoped attributes are simple pairs of strings instead + * of a single string. They can be expressed as a string easily using a delimeter, + * typically an '@' symbol. The scope concept allows certain kinds of filtering to + * be performed more intelligently and efficiently, although not all scoped + * attributes can be effectively filtered (e.g. if the set of scope values is + * unconstrained). + */ + class SHIBSP_API ScopedAttribute : public Attribute + { + public: + /** + * Constructor. + * + * @param ids array with primary identifier in first position, followed by any aliases + * @param delimeter value/scope delimeter when serializing + */ + ScopedAttribute(const std::vector& ids, char delimeter='@') + : Attribute(ids), m_delimeter(delimeter) { + } + + /** + * Constructs based on a remoted ScopedAttribute. + * + * @param in input object containing marshalled ScopedAttribute + */ + ScopedAttribute(DDF& in) : Attribute(in), m_delimeter('@') { + DDF val = in["_delimeter"]; + if (val.isint()) + m_delimeter = static_cast(val.integer()); + val = in.first().first(); + while (val.name() && val.string()) { + m_values.push_back(std::make_pair(std::string(val.name()), std::string(val.string()))); + val = in.first().next(); + } + } + + virtual ~ScopedAttribute() {} + + /** + * Returns the set of values encoded as UTF-8 strings. + * + *

Each compound value is a pair containing the simple value and the scope. + * + * @return a mutable vector of the values + */ + std::vector< std::pair >& getValues() { + return m_values; + } + + size_t valueCount() const { + return m_values.size(); + } + + void clearSerializedValues() { + m_serialized.clear(); + } + + const char* getString(size_t index) const { + return m_values[index].first.c_str(); + } + + const char* getScope(size_t index) const { + return m_values[index].second.c_str(); + } + + void removeValue(size_t index) { + Attribute::removeValue(index); + if (index < m_values.size()) + m_values.erase(m_values.begin() + index); + } + + const std::vector& getSerializedValues() const { + if (m_serialized.empty()) { + for (std::vector< std::pair >::const_iterator i=m_values.begin(); i!=m_values.end(); ++i) + m_serialized.push_back(i->first + m_delimeter + i->second); + } + return Attribute::getSerializedValues(); + } + + DDF marshall() const { + DDF ddf = Attribute::marshall(); + ddf.name("Scoped"); + if (m_delimeter != '@') + ddf.addmember("_delimeter").integer(m_delimeter); + DDF vlist = ddf.first(); + for (std::vector< std::pair >::const_iterator i=m_values.begin(); i!=m_values.end(); ++i) { + DDF val = DDF(i->first.c_str()).string(i->second.c_str()); + vlist.add(val); + } + return ddf; + } + + private: + char m_delimeter; + std::vector< std::pair > m_values; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_scopedattr_h__ */ diff --git a/shibsp/attribute/ScopedAttributeDecoder.cpp b/shibsp/attribute/ScopedAttributeDecoder.cpp new file mode 100644 index 0000000..cdfacad --- /dev/null +++ b/shibsp/attribute/ScopedAttributeDecoder.cpp @@ -0,0 +1,198 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScopedAttributeDecoder.cpp + * + * Decodes SAML into ScopedAttributes + */ + +#include "internal.h" +#include "attribute/AttributeDecoder.h" +#include "attribute/ScopedAttribute.h" + +#include +#include + +using namespace shibsp; +using namespace opensaml::saml1; +using namespace opensaml::saml2; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + static const XMLCh Scope[] = UNICODE_LITERAL_5(S,c,o,p,e); + static const XMLCh scopeDelimeter[] = UNICODE_LITERAL_14(s,c,o,p,e,D,e,l,i,m,e,t,e,r); + + class SHIBSP_DLLLOCAL ScopedAttributeDecoder : virtual public AttributeDecoder + { + public: + ScopedAttributeDecoder(const DOMElement* e) : AttributeDecoder(e), m_delimeter('@') { + if (e) { + if (e->hasAttributeNS(NULL,scopeDelimeter)) { + auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter)); + m_delimeter = *(d.get()); + } + } + } + ~ScopedAttributeDecoder() {} + + shibsp::Attribute* decode( + const vector& ids, const XMLObject* xmlObject, const char* assertingParty=NULL, const char* relyingParty=NULL + ) const; + + private: + char m_delimeter; + }; + + AttributeDecoder* SHIBSP_DLLLOCAL ScopedAttributeDecoderFactory(const DOMElement* const & e) + { + return new ScopedAttributeDecoder(e); + } +}; + +shibsp::Attribute* ScopedAttributeDecoder::decode( + const vector& ids, const XMLObject* xmlObject, const char* assertingParty, const char* relyingParty + ) const +{ + char* val; + char* scope; + const XMLCh* xmlscope; + QName scopeqname(NULL,Scope); + auto_ptr scoped(new ScopedAttribute(ids, m_delimeter)); + scoped->setCaseSensitive(m_caseSensitive); + vector< pair >& dest = scoped->getValues(); + vector::const_iterator v,stop; + + Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder"); + + if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) { + const opensaml::saml2::Attribute* saml2attr = dynamic_cast(xmlObject); + if (saml2attr) { + const vector& values = saml2attr->getAttributeValues(); + v = values.begin(); + stop = values.end(); + if (log.isDebugEnabled()) { + auto_ptr_char n(saml2attr->getName()); + log.debug( + "decoding ScopedAttribute (%s) from SAML 2 Attribute (%s) with %lu value(s)", + ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size() + ); + } + } + else { + const opensaml::saml1::Attribute* saml1attr = dynamic_cast(xmlObject); + if (saml1attr) { + const vector& values = saml1attr->getAttributeValues(); + v = values.begin(); + stop = values.end(); + if (log.isDebugEnabled()) { + auto_ptr_char n(saml1attr->getAttributeName()); + log.debug( + "decoding ScopedAttribute (%s) from SAML 1 Attribute (%s) with %lu value(s)", + ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size() + ); + } + } + else { + log.warn("XMLObject type not recognized by ScopedAttributeDecoder, no values returned"); + return NULL; + } + } + + for (; v!=stop; ++v) { + if (!(*v)->hasChildren()) { + val = toUTF8((*v)->getTextContent()); + if (val && *val) { + const AttributeExtensibleXMLObject* aexo=dynamic_cast(*v); + xmlscope = aexo->getAttribute(scopeqname); + if (xmlscope && *xmlscope) { + scope = toUTF8(xmlscope); + dest.push_back(pair(val,scope)); + delete[] scope; + } + else { + scope = strchr(val, m_delimeter); + if (scope) { + *scope++ = 0; + if (*scope) + dest.push_back(pair(val,scope)); + else + log.warn("ignoring unscoped AttributeValue"); + } + else { + log.warn("ignoring unscoped AttributeValue"); + } + } + } + else { + log.warn("skipping empty AttributeValue"); + } + delete[] val; + } + else { + log.warn("skipping complex AttributeValue"); + } + } + + return dest.empty() ? NULL : scoped.release(); + } + + const NameID* saml2name = dynamic_cast(xmlObject); + if (saml2name) { + if (log.isDebugEnabled()) { + auto_ptr_char f(saml2name->getFormat()); + log.debug("decoding ScopedAttribute (%s) from SAML 2 NameID with Format (%s)", ids.front().c_str(), f.get() ? f.get() : "unspecified"); + } + val = toUTF8(saml2name->getName()); + } + else { + const NameIdentifier* saml1name = dynamic_cast(xmlObject); + if (saml1name) { + if (log.isDebugEnabled()) { + auto_ptr_char f(saml1name->getFormat()); + log.debug( + "decoding ScopedAttribute (%s) from SAML 1 NameIdentifier with Format (%s)", + ids.front().c_str(), f.get() ? f.get() : "unspecified" + ); + } + val = toUTF8(saml1name->getName()); + } + else { + log.warn("XMLObject type not recognized by ScopedAttributeDecoder, no values returned"); + return NULL; + } + } + + if (val && *val && *val!=m_delimeter) { + scope = strchr(val, m_delimeter); + if (scope) { + *scope++ = 0; + if (*scope) + dest.push_back(pair(val,scope)); + else + log.warn("ignoring NameID with no scope"); + } + else { + log.warn("ignoring NameID with no scope delimiter (%c)", m_delimeter); + } + } + else { + log.warn("ignoring empty NameID"); + } + delete[] val; + return dest.empty() ? NULL : scoped.release(); +} diff --git a/shibsp/attribute/SimpleAttribute.h b/shibsp/attribute/SimpleAttribute.h new file mode 100644 index 0000000..39f869c --- /dev/null +++ b/shibsp/attribute/SimpleAttribute.h @@ -0,0 +1,85 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/SimpleAttribute.h + * + * An Attribute whose values are simple strings. + */ + +#ifndef __shibsp_simpattr_h__ +#define __shibsp_simpattr_h__ + +#include + +namespace shibsp { + + /** + * An Attribute whose values are simple strings. + */ + class SHIBSP_API SimpleAttribute : public Attribute + { + public: + /** + * Constructor. + * + * @param ids array with primary identifier in first position, followed by any aliases + */ + SimpleAttribute(const std::vector& ids) : Attribute(ids) {} + + /** + * Constructs based on a remoted SimpleAttribute. + * + * @param in input object containing marshalled SimpleAttribute + */ + SimpleAttribute(DDF& in) : Attribute(in) { + DDF val = in.first().first(); + while (val.string()) { + m_serialized.push_back(val.string()); + val = in.first().next(); + } + } + + virtual ~SimpleAttribute() {} + + /** + * Returns the set of values encoded as UTF-8 strings. + * + *

For simple values, the serialized form is just the actual string, + * so the value array can be directly manipulated. + * + * @return a mutable vector of the values + */ + std::vector& getValues() { + return m_serialized; + } + + void clearSerializedValues() { + // Do nothing, since our values are already serialized. + } + + DDF marshall() const { + DDF ddf = Attribute::marshall(); + DDF vlist = ddf.first(); + for (std::vector::const_iterator i=m_serialized.begin(); i!=m_serialized.end(); ++i) + vlist.add(DDF(NULL).string(i->c_str())); + return ddf; + } + }; + +}; + +#endif /* __shibsp_simpattr_h__ */ diff --git a/shibsp/attribute/StringAttributeDecoder.cpp b/shibsp/attribute/StringAttributeDecoder.cpp new file mode 100644 index 0000000..0e075dd --- /dev/null +++ b/shibsp/attribute/StringAttributeDecoder.cpp @@ -0,0 +1,149 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * StringAttributeDecoder.cpp + * + * Decodes SAML into SimpleAttributes + */ + +#include "internal.h" +#include "attribute/AttributeDecoder.h" +#include "attribute/SimpleAttribute.h" + +#include +#include + +using namespace shibsp; +using namespace opensaml::saml1; +using namespace opensaml::saml2; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + class SHIBSP_DLLLOCAL StringAttributeDecoder : virtual public AttributeDecoder + { + public: + StringAttributeDecoder(const DOMElement* e) : AttributeDecoder(e) {} + ~StringAttributeDecoder() {} + + shibsp::Attribute* decode( + const vector& ids, const XMLObject* xmlObject, const char* assertingParty=NULL, const char* relyingParty=NULL + ) const; + }; + + AttributeDecoder* SHIBSP_DLLLOCAL StringAttributeDecoderFactory(const DOMElement* const & e) + { + return new StringAttributeDecoder(e); + } +}; + +shibsp::Attribute* StringAttributeDecoder::decode( + const vector& ids, const XMLObject* xmlObject, const char* assertingParty, const char* relyingParty + ) const +{ + char* val; + auto_ptr simple(new SimpleAttribute(ids)); + simple->setCaseSensitive(m_caseSensitive); + vector& dest = simple->getValues(); + vector::const_iterator v,stop; + + Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder"); + + if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) { + const opensaml::saml2::Attribute* saml2attr = dynamic_cast(xmlObject); + if (saml2attr) { + const vector& values = saml2attr->getAttributeValues(); + v = values.begin(); + stop = values.end(); + if (log.isDebugEnabled()) { + auto_ptr_char n(saml2attr->getName()); + log.debug( + "decoding SimpleAttribute (%s) from SAML 2 Attribute (%s) with %lu value(s)", + ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size() + ); + } + } + else { + const opensaml::saml1::Attribute* saml1attr = dynamic_cast(xmlObject); + if (saml1attr) { + const vector& values = saml1attr->getAttributeValues(); + v = values.begin(); + stop = values.end(); + if (log.isDebugEnabled()) { + auto_ptr_char n(saml1attr->getAttributeName()); + log.debug( + "decoding SimpleAttribute (%s) from SAML 1 Attribute (%s) with %lu value(s)", + ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size() + ); + } + } + else { + log.warn("XMLObject type not recognized by StringAttributeDecoder, no values returned"); + return NULL; + } + } + + for (; v!=stop; ++v) { + if (!(*v)->hasChildren()) { + val = toUTF8((*v)->getTextContent()); + if (val && *val) + dest.push_back(val); + else + log.warn("skipping empty AttributeValue"); + delete[] val; + } + else { + log.warn("skipping complex AttributeValue"); + } + } + + return dest.empty() ? NULL : simple.release(); + } + + const NameID* saml2name = dynamic_cast(xmlObject); + if (saml2name) { + if (log.isDebugEnabled()) { + auto_ptr_char f(saml2name->getFormat()); + log.debug("decoding SimpleAttribute (%s) from SAML 2 NameID with Format (%s)", ids.front().c_str(), f.get() ? f.get() : "unspecified"); + } + val = toUTF8(saml2name->getName()); + } + else { + const NameIdentifier* saml1name = dynamic_cast(xmlObject); + if (saml1name) { + if (log.isDebugEnabled()) { + auto_ptr_char f(saml1name->getFormat()); + log.debug( + "decoding SimpleAttribute (%s) from SAML 1 NameIdentifier with Format (%s)", + ids.front().c_str(), f.get() ? f.get() : "unspecified" + ); + } + val = toUTF8(saml1name->getName()); + } + else { + log.warn("XMLObject type not recognized by StringAttributeDecoder, no values returned"); + return NULL; + } + } + + if (val && *val) + dest.push_back(val); + else + log.warn("ignoring empty NameID"); + delete[] val; + return dest.empty() ? NULL : simple.release(); +} diff --git a/shibsp/attribute/filtering/AttributeFilter.h b/shibsp/attribute/filtering/AttributeFilter.h new file mode 100644 index 0000000..75521a3 --- /dev/null +++ b/shibsp/attribute/filtering/AttributeFilter.h @@ -0,0 +1,66 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/filtering/AttributeFilter.h + * + * Engine for filtering attribute values. + */ + +#ifndef __shibsp_attrfilt_h__ +#define __shibsp_attrfilt_h__ + +#include + +#include + +namespace shibsp { + + /** + * Engine for filtering attribute values. + */ + class SHIBSP_API AttributeFilter : public virtual xmltooling::Lockable + { + MAKE_NONCOPYABLE(AttributeFilter); + protected: + AttributeFilter() {} + public: + virtual ~AttributeFilter() {} + + /** + * Filters values out of a set of attributes. + * + * @param context a FilteringContext interface + * @param attributes a mutable array containing the attributes to filter + * + * @throws AttributeFileringException thrown if there is a problem filtering attributes + */ + virtual void filterAttributes(const FilteringContext& context, std::vector& attributes) const=0; + }; + + /** + * Registers AttributeFilter classes into the runtime. + */ + void SHIBSP_API registerAttributeFilters(); + + /** AttributeFilter based on an XML mapping schema. */ + #define XML_ATTRIBUTE_FILTER "XML" + + /** AttributeFilter based on chaining together other filters. */ + #define CHAINING_ATTRIBUTE_FILTER "Chaining" +}; + +#endif /* __shibsp_attrfilt_h__ */ diff --git a/shibsp/attribute/filtering/BasicFilteringContext.h b/shibsp/attribute/filtering/BasicFilteringContext.h new file mode 100644 index 0000000..6c66f57 --- /dev/null +++ b/shibsp/attribute/filtering/BasicFilteringContext.h @@ -0,0 +1,92 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/filtering/BasicFilteringContext.h + * + * A trivial FilteringContext implementation. + */ + +#ifndef __shibsp_basicfiltctx_h__ +#define __shibsp_basicfiltctx_h__ + +#include + +namespace shibsp { + + class SHIBSP_API BasicFilteringContext : public FilteringContext + { + public: + /** + * Constructor. + * + * @param app reference to Application + * @param attributes attributes being filtered + * @param role metadata role of Attribute issuer, if any + * @param authncontext_class method/category of authentication event, if known + * @param authncontext_decl specifics of authentication event, if known + */ + BasicFilteringContext( + const Application& app, + const std::vector& attributes, + const opensaml::saml2md::RoleDescriptor* role=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL + ) : m_app(app), m_role(role), m_issuer(NULL), m_class(authncontext_class), m_decl(authncontext_decl) { + if (role) + m_issuer = dynamic_cast(role->getParent())->getEntityID(); + for (std::vector::const_iterator a = attributes.begin(); a != attributes.end(); ++a) + m_attributes.insert(std::multimap::value_type((*a)->getId(), *a)); + } + + virtual ~BasicFilteringContext() {} + + const Application& getApplication() const { + return m_app; + } + const XMLCh* getAuthnContextClassRef() const { + return m_class; + } + const XMLCh* getAuthnContextDeclRef() const { + return m_decl; + } + const XMLCh* getAttributeRequester() const { + return m_app.getXMLString("entityID").second; + } + const XMLCh* getAttributeIssuer() const { + return m_issuer; + } + const opensaml::saml2md::RoleDescriptor* getAttributeRequesterMetadata() const { + return NULL; + } + const opensaml::saml2md::RoleDescriptor* getAttributeIssuerMetadata() const { + return m_role; + } + const std::multimap& getAttributes() const { + return m_attributes; + } + + private: + const Application& m_app; + std::multimap m_attributes; + const opensaml::saml2md::RoleDescriptor* m_role; + const XMLCh* m_issuer; + const XMLCh* m_class; + const XMLCh* m_decl; + }; +}; + +#endif /* __shibsp_basicfiltctx_h__ */ diff --git a/shibsp/attribute/filtering/FilterPolicyContext.h b/shibsp/attribute/filtering/FilterPolicyContext.h new file mode 100644 index 0000000..2fff8ae --- /dev/null +++ b/shibsp/attribute/filtering/FilterPolicyContext.h @@ -0,0 +1,67 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/filtering/FilterPolicyContext.h + * + * Context for lookup of instantiated MatchFunctor objects. + */ + +#ifndef __shibsp_filtpolctx_h__ +#define __shibsp_filtpolctx_h__ + +#include + +#include +#include + +namespace shibsp { + + /** + * Context for lookup of instantiated MatchFunctor objects. + */ + class SHIBSP_API FilterPolicyContext + { + MAKE_NONCOPYABLE(FilterPolicyContext); + public: + /** + * Constructor. + * + * @param functors reference to a map of id/functor pairs + */ + FilterPolicyContext(std::multimap& functors) : m_functors(functors) { + } + + virtual ~FilterPolicyContext() {} + + /** + * Gets a mutable map to store id/functor pairs. + * + *

When storing new instances, use an empty string for unnamed objects. + * + * @return reference to a mutable map containing available MatchFunctors + */ + std::multimap& getMatchFunctors() const { + return m_functors; + } + + private: + std::multimap& m_functors; + }; + +}; + +#endif /* __shibsp_filtpolctx_h__ */ diff --git a/shibsp/attribute/filtering/FilteringContext.h b/shibsp/attribute/filtering/FilteringContext.h new file mode 100644 index 0000000..c4e3032 --- /dev/null +++ b/shibsp/attribute/filtering/FilteringContext.h @@ -0,0 +1,110 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/filtering/FilteringContext.h + * + * Context for attribute filtering operations. + */ + +#ifndef __shibsp_filtctx_h__ +#define __shibsp_filtctx_h__ + +#include + +#include + +namespace shibsp { + + class SHIBSP_API Application; + class SHIBSP_API Attribute; + + /** + * Context for attribute filtering operations. + */ + class SHIBSP_API FilteringContext + { + MAKE_NONCOPYABLE(FilteringContext); + protected: + FilteringContext() {} + public: + virtual ~FilteringContext() {} + + /** + * Gets the Application doing the filtering. + * + * @return reference to an Application + */ + virtual const Application& getApplication() const=0; + + /** + * Returns a URI containing an AuthnContextClassRef associated with the subject. + * + *

SAML 1.x AuthenticationMethods will be returned as class references. + * + * @return a URI identifying the authentication context class + */ + virtual const XMLCh* getAuthnContextClassRef() const=0; + + /** + * Returns a URI containing an AuthnContextDeclRef associated with the subject. + * + * @return a URI identifying the authentication context declaration + */ + virtual const XMLCh* getAuthnContextDeclRef() const=0; + + /** + * Gets the ID of the requester of the attributes, if known. + * + * @return requester of the attributes, or NULL + */ + virtual const XMLCh* getAttributeRequester() const=0; + + /** + * Gets the ID of the issuer of the attributes, if known. + * + * @return ID of the issuer of the attributes, or NULL + */ + virtual const XMLCh* getAttributeIssuer() const=0; + + /** + * Gets the SAML metadata for the attribute requesting role, if available. + * + * @return SAML metadata for the attribute requesting role, or NULL + */ + virtual const opensaml::saml2md::RoleDescriptor* getAttributeRequesterMetadata() const=0; + + /** + * Gets the SAML metadata for the attribute issuing role, if available. + * + * @return SAML metadata for the attribute issuing role, or NULL + */ + virtual const opensaml::saml2md::RoleDescriptor* getAttributeIssuerMetadata() const=0; + + /** + * Returns the set of Attributes being filtered. + * + *

No modifications should be performed, access is provided only for use by + * MatchFunctors based on the presence of Attribute data. + * + * @return an immutable map of Attributes. + */ + virtual const std::multimap& getAttributes() const=0; + + }; +}; + +#endif /* __shibsp_filtctx_h__ */ diff --git a/shibsp/attribute/filtering/MatchFunctor.h b/shibsp/attribute/filtering/MatchFunctor.h new file mode 100644 index 0000000..6018414 --- /dev/null +++ b/shibsp/attribute/filtering/MatchFunctor.h @@ -0,0 +1,127 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/filtering/MatchFunctor.h + * + * A function that evaluates whether an expressed criteria is met by the current filter context. + */ + +#ifndef __shibsp_matchfunc_h__ +#define __shibsp_matchfunc_h__ + +#include + +namespace shibsp { + + class SHIBSP_API Attribute; + class SHIBSP_API FilteringContext; + + /** + * A function that evaluates whether an expressed criteria is met by the current filter context. + */ + class SHIBSP_API MatchFunctor + { + MAKE_NONCOPYABLE(MatchFunctor); + protected: + MatchFunctor() {} + public: + virtual ~MatchFunctor() {} + + /** + * Evaluates this matching criteria. This evaluation is used when a filtering engine determines policy + * applicability. + * + * @param filterContext current filtering context + * @return true if the criteria for this matching function are met + * @throws AttributeFilteringException thrown if the function can not be evaluated + */ + virtual bool evaluatePolicyRequirement(const FilteringContext& filterContext) const=0; + + /** + * Evaluates this matching criteria. This evaluation is used when a filtering engine is filtering attribute + * values. + * + * @param filterContext the current filtering context + * @param attribute the attribute being evaluated + * @param index the index of the attribute value being evaluated + * @return true if the criteria for this matching function are met + * @throws AttributeFilteringException thrown if the function can not be evaluated + */ + virtual bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const=0; + }; + + /** Always evaluates to true. */ + extern SHIBSP_API xmltooling::QName AnyMatchFunctorType; + + /** Conjunction MatchFunctor. */ + extern SHIBSP_API xmltooling::QName AndMatchFunctorType; + + /** Disjunction MatchFunctor. */ + extern SHIBSP_API xmltooling::QName OrMatchFunctorType; + + /** Negating MatchFunctor. */ + extern SHIBSP_API xmltooling::QName NotMatchFunctorType; + + /** Matches the issuing entity's name. */ + extern SHIBSP_API xmltooling::QName AttributeIssuerStringType; + + /** Matches the requesting entity's name. */ + extern SHIBSP_API xmltooling::QName AttributeRequesterStringType; + + /** Matches the principal's authentication method/class or context reference. */ + extern SHIBSP_API xmltooling::QName AuthenticationMethodStringType; + + /** Matches an attribute's string value. */ + extern SHIBSP_API xmltooling::QName AttributeValueStringType; + + /** Matches an attribute's "scope". */ + extern SHIBSP_API xmltooling::QName AttributeScopeStringType; + + /** Matches the issuing entity's name. */ + extern SHIBSP_API xmltooling::QName AttributeIssuerRegexType; + + /** Matches the requesting entity's name. */ + extern SHIBSP_API xmltooling::QName AttributeRequesterRegexType; + + /** Matches the principal's authentication method/class or context reference. */ + extern SHIBSP_API xmltooling::QName AuthenticationMethodRegexType; + + /** Matches an attribute's string value. */ + extern SHIBSP_API xmltooling::QName AttributeValueRegexType; + + /** Matches an attribute's "scope". */ + extern SHIBSP_API xmltooling::QName AttributeScopeRegexType; + + /** Matches based on the number of values. */ + extern SHIBSP_API xmltooling::QName NumberOfAttributeValuesType; + + /** Matches based on metadata groups of issuer. */ + extern SHIBSP_API xmltooling::QName AttributeIssuerInEntityGroupType; + + /** Matches based on metadata groups of requester. */ + extern SHIBSP_API xmltooling::QName AttributeRequesterInEntityGroupType; + + /** Matches based on metadata Scope extensions. */ + extern SHIBSP_API xmltooling::QName AttributeScopeMatchesShibMDScopeType; + + /** + * Registers MatchFunctor classes into the runtime. + */ + void SHIBSP_API registerMatchFunctors(); +}; + +#endif /* __shibsp_matchfunc_h__ */ diff --git a/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp b/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp new file mode 100644 index 0000000..857050d --- /dev/null +++ b/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp @@ -0,0 +1,119 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AndMatchFunctor.cpp + * + * A MatchFunctor that logical ANDs the results of contained functors. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilterPolicyContext.h" +#include "util/SPConstants.h" + +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + /** + * A MatchFunctor that logical ANDs the results of contained functors. + */ + class SHIBSP_DLLLOCAL AndMatchFunctor : public MatchFunctor + { + public: + AndMatchFunctor(const pair& p); + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + if (m_functors.empty()) + return false; + for (vector::const_iterator mf = m_functors.begin(); mf!=m_functors.end(); ++mf) + if (!(*mf)->evaluatePolicyRequirement(filterContext)) + return false; + return true; + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + if (m_functors.empty()) + return false; + for (vector::const_iterator mf = m_functors.begin(); mf!=m_functors.end(); ++mf) + if (!(*mf)->evaluatePermitValue(filterContext, attribute, index)) + return false; + return true; + } + + private: + MatchFunctor* buildFunctor(const DOMElement* e, const FilterPolicyContext* functorMap); + + vector m_functors; + }; + + MatchFunctor* SHIBSP_DLLLOCAL AndMatchFunctorFactory(const pair& p) + { + return new AndMatchFunctor(p); + } + + static XMLCh _id[] = UNICODE_LITERAL_2(i,d); + static XMLCh _ref[] = UNICODE_LITERAL_3(r,e,f); + static XMLCh Rule[] = UNICODE_LITERAL_4(R,u,l,e); + static XMLCh RuleReference[] = UNICODE_LITERAL_13(R,u,l,e,R,e,f,e,r,e,n,c,e); +}; + +AndMatchFunctor::AndMatchFunctor(const pair& p) +{ + MatchFunctor* func; + const DOMElement* e = XMLHelper::getFirstChildElement(p.second); + while (e) { + func = NULL; + if (XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, Rule)) { + func = buildFunctor(e, p.first); + } + else if (XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, RuleReference)) { + auto_ptr_char ref(e->getAttributeNS(NULL, _ref)); + if (ref.get() && *ref.get()) { + multimap::const_iterator rule = p.first->getMatchFunctors().find(ref.get()); + func = (rule!=p.first->getMatchFunctors().end()) ? rule->second : NULL; + } + } + + if (func) + m_functors.push_back(func); + + e = XMLHelper::getNextSiblingElement(e); + } +} + +MatchFunctor* AndMatchFunctor::buildFunctor(const DOMElement* e, const FilterPolicyContext* functorMap) +{ + // We'll track and map IDs just for consistency, but don't require them or worry about dups. + auto_ptr_char temp(e->getAttributeNS(NULL,_id)); + const char* id = (temp.get() && *temp.get()) ? temp.get() : ""; + if (*id && functorMap->getMatchFunctors().count(id)) + id = ""; + + auto_ptr type(XMLHelper::getXSIType(e)); + if (!type.get()) + throw ConfigurationException("Child Rule found with no xsi:type."); + + MatchFunctor* func = SPConfig::getConfig().MatchFunctorManager.newPlugin(*type.get(), make_pair(functorMap,e)); + functorMap->getMatchFunctors().insert(multimap::value_type(id, func)); + return func; +} diff --git a/shibsp/attribute/filtering/impl/AnyMatchFunctor.cpp b/shibsp/attribute/filtering/impl/AnyMatchFunctor.cpp new file mode 100644 index 0000000..a782f78 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AnyMatchFunctor.cpp @@ -0,0 +1,50 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AnyMatchFunctor.cpp + * + * A match function that returns true to evaluations. + */ + +#include "internal.h" +#include "attribute/filtering/FilterPolicyContext.h" + +using namespace shibsp; + +namespace shibsp { + + /** + * A match function that returns true to evaluations. Note, the result may still be negated. + */ + class SHIBSP_DLLLOCAL AnyMatchFunctor : public MatchFunctor + { + public: + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + return true; + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return true; + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AnyMatchFunctorFactory(const std::pair& p) + { + return new AnyMatchFunctor(); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeFilter.cpp b/shibsp/attribute/filtering/impl/AttributeFilter.cpp new file mode 100644 index 0000000..ad21399 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeFilter.cpp @@ -0,0 +1,40 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeFilter.cpp + * + * Engine for filtering attribute values. + */ + +#include "internal.h" +#include "attribute/filtering/AttributeFilter.h" + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + SHIBSP_DLLLOCAL PluginManager::Factory XMLAttributeFilterFactory; + SHIBSP_DLLLOCAL PluginManager::Factory ChainingAttributeFilterFactory; +}; + +void SHIBSP_API shibsp::registerAttributeFilters() +{ + SPConfig& conf = SPConfig::getConfig(); + conf.AttributeFilterManager.registerFactory(XML_ATTRIBUTE_FILTER, XMLAttributeFilterFactory); + conf.AttributeFilterManager.registerFactory(CHAINING_ATTRIBUTE_FILTER, ChainingAttributeFilterFactory); +} diff --git a/shibsp/attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp new file mode 100644 index 0000000..6825fe3 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp @@ -0,0 +1,72 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeIssuerInEntityGroupFunctor.cpp + * + * A match function that evaluates to true if the attribute issuer is found in metadata and is a member + * of the given entity group. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +using namespace opensaml::saml2md; + +namespace shibsp { + + static const XMLCh groupID[] = UNICODE_LITERAL_7(g,r,o,u,p,I,D); + + /** + * A match function that evaluates to true if the attribute issuer is found in metadata and is a member + * of the given entity group. + */ + class SHIBSP_DLLLOCAL AttributeIssuerInEntityGroupFunctor : public MatchFunctor + { + const XMLCh* m_group; + public: + AttributeIssuerInEntityGroupFunctor(const DOMElement* e) { + m_group = e ? e->getAttributeNS(NULL,groupID) : NULL; + if (!m_group || !*m_group) + throw ConfigurationException("AttributeIssuerInEntityGroup MatchFunctor requires non-empty groupID attribute."); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + const RoleDescriptor* issuer = filterContext.getAttributeIssuerMetadata(); + if (!issuer) + return false; + const EntitiesDescriptor* group = dynamic_cast(issuer->getParent()->getParent()); + while (group) { + if (XMLString::equals(group->getName(), m_group)) + return true; + group = dynamic_cast(group->getParent()); + } + return false; + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return evaluatePolicyRequirement(filterContext); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeIssuerInEntityGroupFactory(const std::pair& p) + { + return new AttributeIssuerInEntityGroupFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp new file mode 100644 index 0000000..f342f61 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp @@ -0,0 +1,75 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeIssuerRegexFunctor.cpp + * + * A match function that evaluates to true if the Attribute issuer matches the provided regular + * expression. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +#include + +namespace shibsp { + + static const XMLCh options[] = UNICODE_LITERAL_7(o,p,t,i,o,n,s); + static const XMLCh regex[] = UNICODE_LITERAL_5(r,e,g,e,x); + + /** + * A match function that evaluates to true if the Attribute issuer matches the provided regular + * expression. + */ + class SHIBSP_DLLLOCAL AttributeIssuerRegexFunctor : public MatchFunctor + { + RegularExpression* m_regex; + public: + AttributeIssuerRegexFunctor(const DOMElement* e) { + const XMLCh* r = e ? e->getAttributeNS(NULL,regex) : NULL; + if (!r || !*r) + throw ConfigurationException("AttributeIssuerRegex MatchFunctor requires non-empty regex attribute."); + try { + m_regex = new RegularExpression(r, e->getAttributeNS(NULL,options)); + } + catch (XMLException& ex) { + xmltooling::auto_ptr_char temp(ex.getMessage()); + throw ConfigurationException(temp.get()); + } + } + + virtual ~AttributeIssuerRegexFunctor() { + delete m_regex; + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + return m_regex->matches(filterContext.getAttributeIssuer()); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return m_regex->matches(filterContext.getAttributeIssuer()); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeIssuerRegexFactory(const std::pair& p) + { + return new AttributeIssuerRegexFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp new file mode 100644 index 0000000..c2b193f --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp @@ -0,0 +1,59 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeIssuerStringFunctor.cpp + * + * A match function that matches the attribute issuer's name against the specified value. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +namespace shibsp { + + static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e); + + /** + * A match function that matches the attribute issuer's name against the specified value. + */ + class SHIBSP_DLLLOCAL AttributeIssuerStringFunctor : public MatchFunctor + { + const XMLCh* m_value; + public: + AttributeIssuerStringFunctor(const DOMElement* e) { + m_value = e ? e->getAttributeNS(NULL,value) : NULL; + if (!m_value || !*m_value) + throw ConfigurationException("AttributeIssuerString MatchFunctor requires non-empty value attribute."); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + return XMLString::equals(m_value, filterContext.getAttributeIssuer()); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return XMLString::equals(m_value, filterContext.getAttributeIssuer()); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeIssuerStringFactory(const std::pair& p) + { + return new AttributeIssuerStringFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp new file mode 100644 index 0000000..e774a7a --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp @@ -0,0 +1,72 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeRequesterInEntityGroupFunctor.cpp + * + * A match function that evaluates to true if the attribute requester is found in metadata and is a member + * of the given entity group. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +using namespace opensaml::saml2md; + +namespace shibsp { + + static const XMLCh groupID[] = UNICODE_LITERAL_7(g,r,o,u,p,I,D); + + /** + * A match function that evaluates to true if the attribute requester is found in metadata and is a member + * of the given entity group. + */ + class SHIBSP_DLLLOCAL AttributeRequesterInEntityGroupFunctor : public MatchFunctor + { + const XMLCh* m_group; + public: + AttributeRequesterInEntityGroupFunctor(const DOMElement* e) { + m_group = e ? e->getAttributeNS(NULL,groupID) : NULL; + if (!m_group || !*m_group) + throw ConfigurationException("AttributeRequesterInEntityGroup MatchFunctor requires non-empty groupID attribute."); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + const RoleDescriptor* req = filterContext.getAttributeRequesterMetadata(); + if (!req) + return false; + const EntitiesDescriptor* group = dynamic_cast(req->getParent()->getParent()); + while (group) { + if (XMLString::equals(group->getName(), m_group)) + return true; + group = dynamic_cast(group->getParent()); + } + return false; + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return evaluatePolicyRequirement(filterContext); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeRequesterInEntityGroupFactory(const std::pair& p) + { + return new AttributeRequesterInEntityGroupFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp new file mode 100644 index 0000000..1bbdc23 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp @@ -0,0 +1,75 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeRequesterRegexFunctor.cpp + * + * A match function that evaluates to true if the Attribute requester matches the provided regular + * expression. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +#include + +namespace shibsp { + + static const XMLCh options[] = UNICODE_LITERAL_7(o,p,t,i,o,n,s); + static const XMLCh regex[] = UNICODE_LITERAL_5(r,e,g,e,x); + + /** + * A match function that evaluates to true if the Attribute requester matches the provided regular + * expression. + */ + class SHIBSP_DLLLOCAL AttributeRequesterRegexFunctor : public MatchFunctor + { + RegularExpression* m_regex; + public: + AttributeRequesterRegexFunctor(const DOMElement* e) { + const XMLCh* r = e ? e->getAttributeNS(NULL,regex) : NULL; + if (!r || !*r) + throw ConfigurationException("AttributeRequesterRegex MatchFunctor requires non-empty regex attribute."); + try { + m_regex = new RegularExpression(r, e->getAttributeNS(NULL,options)); + } + catch (XMLException& ex) { + xmltooling::auto_ptr_char temp(ex.getMessage()); + throw ConfigurationException(temp.get()); + } + } + + virtual ~AttributeRequesterRegexFunctor() { + delete m_regex; + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + return m_regex->matches(filterContext.getAttributeRequester()); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return m_regex->matches(filterContext.getAttributeRequester()); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeRequesterRegexFactory(const std::pair& p) + { + return new AttributeRequesterRegexFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp new file mode 100644 index 0000000..fb8182b --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp @@ -0,0 +1,59 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeRequesterStringFunctor.cpp + * + * A match function that matches the attribute requester's name against the specified value. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +namespace shibsp { + + static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e); + + /** + * A match function that matches the attribute requester's name against the specified value. + */ + class SHIBSP_DLLLOCAL AttributeRequesterStringFunctor : public MatchFunctor + { + const XMLCh* m_value; + public: + AttributeRequesterStringFunctor(const DOMElement* e) { + m_value = e ? e->getAttributeNS(NULL,value) : NULL; + if (!m_value || !*m_value) + throw ConfigurationException("AttributeRequesterString MatchFunctor requires non-empty value attribute."); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + return XMLString::equals(m_value, filterContext.getAttributeRequester()); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return XMLString::equals(m_value, filterContext.getAttributeRequester()); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeRequesterStringFactory(const std::pair& p) + { + return new AttributeRequesterStringFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp new file mode 100644 index 0000000..b7899b3 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp @@ -0,0 +1,118 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeScopeMatchesShibMDScopeFunctor.cpp + * + * A match function that ensures that an attributes value's scope matches a scope given in metadata for the entity or role. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" +#include "metadata/MetadataExt.h" + +#include + +using namespace opensaml::saml2md; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + static const XMLCh groupID[] = UNICODE_LITERAL_7(g,r,o,u,p,I,D); + + /** + * A match function that ensures that an attributes value's scope matches a scope given in metadata for the entity or role. + */ + class SHIBSP_DLLLOCAL AttributeScopeMatchesShibMDScopeFunctor : public MatchFunctor + { + public: + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + throw AttributeFilteringException("Metadata scope matching not usable as a PolicyRequirement."); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + const RoleDescriptor* issuer = filterContext.getAttributeIssuerMetadata(); + if (!issuer) + return false; + + const char* scope = attribute.getScope(index); + if (!scope || !*scope) + return false; + + const Scope* rule; + const XMLCh* widescope=NULL; + const Extensions* ext = issuer->getExtensions(); + if (ext) { + const vector& exts = ext->getUnknownXMLObjects(); + for (vector::const_iterator e = exts.begin(); e!=exts.end(); ++e) { + rule = dynamic_cast(*e); + if (rule) { + if (!widescope) + widescope = fromUTF8(scope); + if (matches(*rule, widescope)) { + delete[] widescope; + return true; + } + } + } + } + + ext = dynamic_cast(issuer->getParent())->getExtensions(); + if (ext) { + const vector& exts = ext->getUnknownXMLObjects(); + for (vector::const_iterator e = exts.begin(); e!=exts.end(); ++e) { + rule = dynamic_cast(*e); + if (rule) { + if (!widescope) + widescope = fromUTF8(scope); + if (matches(*rule, widescope)) { + delete[] widescope; + return true; + } + } + } + } + + delete[] widescope; + return false; + } + + private: + bool matches(const Scope& rule, const XMLCh* scope) const { + const XMLCh* val = rule.getValue(); + if (val && *val) { + if (rule.Regexp()) { + RegularExpression re(val); + return re.matches(scope); + } + else { + return XMLString::equals(val, scope); + } + } + return false; + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeScopeMatchesShibMDScopeFactory(const std::pair& p) + { + return new AttributeScopeMatchesShibMDScopeFunctor(); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AttributeScopeRegexFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeScopeRegexFunctor.cpp new file mode 100644 index 0000000..c3e58e8 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeScopeRegexFunctor.cpp @@ -0,0 +1,110 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeScopeRegexFunctor.cpp + * + * A match function that evaluates an attribute value's scope against the provided regular expression. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +#include + +using namespace shibsp; +using namespace std; + +namespace shibsp { + + static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D); + static const XMLCh options[] = UNICODE_LITERAL_7(o,p,t,i,o,n,s); + static const XMLCh regex[] = UNICODE_LITERAL_5(r,e,g,e,x); + + /** + * A match function that evaluates an attribute value's scope against the provided regular expression. + */ + class SHIBSP_DLLLOCAL AttributeScopeRegexFunctor : public MatchFunctor + { + xmltooling::auto_ptr_char m_attributeID; + RegularExpression* m_regex; + + bool hasScope(const FilteringContext& filterContext) const; + bool matches(const Attribute& attribute, size_t index) const; + + public: + AttributeScopeRegexFunctor(const DOMElement* e) + : m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) { + const XMLCh* r = e ? e->getAttributeNS(NULL,regex) : NULL; + if (!r || !*r) + throw ConfigurationException("AttributeScopeRegex MatchFunctor requires non-empty regex attribute."); + try { + m_regex = new RegularExpression(r, e->getAttributeNS(NULL,options)); + } + catch (XMLException& ex) { + xmltooling::auto_ptr_char temp(ex.getMessage()); + throw ConfigurationException(temp.get()); + } + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + if (!m_attributeID.get() || !*m_attributeID.get()) + throw AttributeFilteringException("No attributeID specified."); + return hasScope(filterContext); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + if (!m_attributeID.get() || !*m_attributeID.get() || XMLString::equals(m_attributeID.get(), attribute.getId())) + return matches(attribute, index); + return hasScope(filterContext); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeScopeRegexFactory(const std::pair& p) + { + return new AttributeScopeRegexFunctor(p.second); + } + +}; + +bool AttributeScopeRegexFunctor::hasScope(const FilteringContext& filterContext) const +{ + size_t count; + pair::const_iterator,multimap::const_iterator> attrs = + filterContext.getAttributes().equal_range(m_attributeID.get()); + for (; attrs.first != attrs.second; ++attrs.first) { + count = attrs.first->second->valueCount(); + for (size_t index = 0; index < count; ++index) { + if (matches(*(attrs.first->second), index)) + return true; + } + } + return false; +} + +bool AttributeScopeRegexFunctor::matches(const Attribute& attribute, size_t index) const +{ + const char* val = attribute.getScope(index); + if (!val) + return false; + XMLCh* temp = xmltooling::fromUTF8(val); + bool ret = m_regex->matches(temp); + delete[] temp; + return ret; +} diff --git a/shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp new file mode 100644 index 0000000..d9749fc --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp @@ -0,0 +1,87 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeScopeStringFunctor.cpp + * + * A match function that matches the scope of an attribute value against the specified value. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +using namespace shibsp; +using namespace std; + +namespace shibsp { + + static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D); + static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e); + + /** + * A match function that matches the scope of an attribute value against the specified value. + */ + class SHIBSP_DLLLOCAL AttributeScopeStringFunctor : public MatchFunctor + { + xmltooling::auto_ptr_char m_value; + xmltooling::auto_ptr_char m_attributeID; + + bool hasScope(const FilteringContext& filterContext) const; + + public: + AttributeScopeStringFunctor(const DOMElement* e) + : m_value(e ? e->getAttributeNS(NULL,value) : NULL), m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) { + if (!m_value.get() || !*m_value.get()) + throw ConfigurationException("AttributeScopeString MatchFunctor requires non-empty value attribute."); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + if (!m_attributeID.get() || !*m_attributeID.get()) + throw AttributeFilteringException("No attributeID specified."); + return hasScope(filterContext); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + if (!m_attributeID.get() || !*m_attributeID.get() || XMLString::equals(m_attributeID.get(), attribute.getId())) + return XMLString::equals(attribute.getScope(index), m_value.get()); + return hasScope(filterContext); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeScopeStringFactory(const std::pair& p) + { + return new AttributeScopeStringFunctor(p.second); + } + +}; + +bool AttributeScopeStringFunctor::hasScope(const FilteringContext& filterContext) const +{ + size_t count; + pair::const_iterator,multimap::const_iterator> attrs = + filterContext.getAttributes().equal_range(m_attributeID.get()); + for (; attrs.first != attrs.second; ++attrs.first) { + count = attrs.first->second->valueCount(); + for (size_t index = 0; index < count; ++index) { + if (XMLString::equals(attrs.first->second->getScope(index), m_value.get())) + return true; + } + } + return false; +} diff --git a/shibsp/attribute/filtering/impl/AttributeValueRegexFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeValueRegexFunctor.cpp new file mode 100644 index 0000000..5fc4fa0 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeValueRegexFunctor.cpp @@ -0,0 +1,110 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeValueRegexFunctor.cpp + * + * A match function that evaluates an attribute's value against the provided regular expression. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +#include + +using namespace shibsp; +using namespace std; + +namespace shibsp { + + static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D); + static const XMLCh options[] = UNICODE_LITERAL_7(o,p,t,i,o,n,s); + static const XMLCh regex[] = UNICODE_LITERAL_5(r,e,g,e,x); + + /** + * A match function that evaluates an attribute's value against the provided regular expression. + */ + class SHIBSP_DLLLOCAL AttributeValueRegexFunctor : public MatchFunctor + { + xmltooling::auto_ptr_char m_attributeID; + RegularExpression* m_regex; + + bool hasValue(const FilteringContext& filterContext) const; + bool matches(const Attribute& attribute, size_t index) const; + + public: + AttributeValueRegexFunctor(const DOMElement* e) + : m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) { + const XMLCh* r = e ? e->getAttributeNS(NULL,regex) : NULL; + if (!r || !*r) + throw ConfigurationException("AttributeValueRegex MatchFunctor requires non-empty regex attribute."); + try { + m_regex = new RegularExpression(r, e->getAttributeNS(NULL,options)); + } + catch (XMLException& ex) { + xmltooling::auto_ptr_char temp(ex.getMessage()); + throw ConfigurationException(temp.get()); + } + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + if (!m_attributeID.get() || !*m_attributeID.get()) + throw AttributeFilteringException("No attributeID specified."); + return hasValue(filterContext); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + if (!m_attributeID.get() || !*m_attributeID.get() || XMLString::equals(m_attributeID.get(), attribute.getId())) + return matches(attribute, index); + return hasValue(filterContext); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeValueRegexFactory(const std::pair& p) + { + return new AttributeValueRegexFunctor(p.second); + } + +}; + +bool AttributeValueRegexFunctor::hasValue(const FilteringContext& filterContext) const +{ + size_t count; + pair::const_iterator,multimap::const_iterator> attrs = + filterContext.getAttributes().equal_range(m_attributeID.get()); + for (; attrs.first != attrs.second; ++attrs.first) { + count = attrs.first->second->valueCount(); + for (size_t index = 0; index < count; ++index) { + if (matches(*(attrs.first->second), index)) + return true; + } + } + return false; +} + +bool AttributeValueRegexFunctor::matches(const Attribute& attribute, size_t index) const +{ + const char* val = attribute.getString(index); + if (!val) + return false; + XMLCh* temp = xmltooling::fromUTF8(val); + bool ret = m_regex->matches(temp); + delete[] temp; + return ret; +} diff --git a/shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp new file mode 100644 index 0000000..0c2739c --- /dev/null +++ b/shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp @@ -0,0 +1,103 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AttributeValueStringFunctor.cpp + * + * A match function that matches the value of an attribute against the specified value. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +using namespace shibsp; +using namespace std; + +namespace shibsp { + + static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D); + static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e); + + /** + * A match function that matches the value of an attribute against the specified value. + */ + class SHIBSP_DLLLOCAL AttributeValueStringFunctor : public MatchFunctor + { + xmltooling::auto_ptr_char m_value; + xmltooling::auto_ptr_char m_attributeID; + + bool hasValue(const FilteringContext& filterContext) const; + bool matches(const Attribute& attribute, size_t index) const; + + public: + AttributeValueStringFunctor(const DOMElement* e) + : m_value(e ? e->getAttributeNS(NULL,value) : NULL), m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) { + if (!m_value.get() || !*m_value.get()) + throw ConfigurationException("AttributeValueString MatchFunctor requires non-empty value attribute."); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + if (!m_attributeID.get() || !*m_attributeID.get()) + throw AttributeFilteringException("No attributeID specified."); + return hasValue(filterContext); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + if (!m_attributeID.get() || !*m_attributeID.get() || XMLString::equals(m_attributeID.get(), attribute.getId())) + return matches(attribute, index); + return hasValue(filterContext); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AttributeValueStringFactory(const std::pair& p) + { + return new AttributeValueStringFunctor(p.second); + } + +}; + +bool AttributeValueStringFunctor::hasValue(const FilteringContext& filterContext) const +{ + size_t count; + pair::const_iterator,multimap::const_iterator> attrs = + filterContext.getAttributes().equal_range(m_attributeID.get()); + for (; attrs.first != attrs.second; ++attrs.first) { + count = attrs.first->second->valueCount(); + for (size_t index = 0; index < count; ++index) { + if (matches(*(attrs.first->second), index)) + return true; + } + } + return false; +} + +bool AttributeValueStringFunctor::matches(const Attribute& attribute, size_t index) const +{ + const char* val = attribute.getString(index); + if (!val) + return false; + if (attribute.isCaseSensitive()) + return !strcmp(m_value.get(), val); + +#ifdef HAVE_STRCASECMP + return !strcasecmp(m_value.get(), val); +#else + return !stricmp(m_value.get(), val); +#endif +} diff --git a/shibsp/attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp b/shibsp/attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp new file mode 100644 index 0000000..b66bbbd --- /dev/null +++ b/shibsp/attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp @@ -0,0 +1,75 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AuthenticationMethodRegexFunctor.cpp + * + * A match function that evaluates to true if the user's authentication method matches the provided regular + * expression. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +#include + +namespace shibsp { + + static const XMLCh options[] = UNICODE_LITERAL_7(o,p,t,i,o,n,s); + static const XMLCh regex[] = UNICODE_LITERAL_5(r,e,g,e,x); + + /** + * A match function that evaluates to true if the user's authentication method matches the provided regular + * expression. + */ + class SHIBSP_DLLLOCAL AuthenticationMethodRegexFunctor : public MatchFunctor + { + RegularExpression* m_regex; + public: + AuthenticationMethodRegexFunctor(const DOMElement* e) { + const XMLCh* r = e ? e->getAttributeNS(NULL,regex) : NULL; + if (!r || !*r) + throw ConfigurationException("AuthenticationMethodRegex MatchFunctor requires non-empty regex attribute."); + try { + m_regex = new RegularExpression(r, e->getAttributeNS(NULL,options)); + } + catch (XMLException& ex) { + xmltooling::auto_ptr_char temp(ex.getMessage()); + throw ConfigurationException(temp.get()); + } + } + + virtual ~AuthenticationMethodRegexFunctor() { + delete m_regex; + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + return (m_regex->matches(filterContext.getAuthnContextClassRef()) || m_regex->matches(filterContext.getAuthnContextDeclRef())); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return (m_regex->matches(filterContext.getAuthnContextClassRef()) || m_regex->matches(filterContext.getAuthnContextDeclRef())); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AuthenticationMethodRegexFactory(const std::pair& p) + { + return new AuthenticationMethodRegexFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp b/shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp new file mode 100644 index 0000000..69df276 --- /dev/null +++ b/shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp @@ -0,0 +1,60 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AuthenticationMethodStringFunctor.cpp + * + * Match functor that compares the user's authentication method against a given string. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +namespace shibsp { + + static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e); + + /** + * Match functor that compares the user's authentication method against a given string. + */ + class SHIBSP_DLLLOCAL AuthenticationMethodStringFunctor : public MatchFunctor + { + const XMLCh* m_value; + public: + AuthenticationMethodStringFunctor(const DOMElement* e) : m_value(e ? e->getAttributeNS(NULL,value) : NULL) { + if (!m_value || !*m_value) + throw ConfigurationException("AuthenticationMethodString MatchFunctor requires non-empty value attribute."); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + return XMLString::equals(m_value, filterContext.getAuthnContextClassRef()) || + XMLString::equals(m_value, filterContext.getAuthnContextDeclRef()); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + return XMLString::equals(m_value, filterContext.getAuthnContextClassRef()) || + XMLString::equals(m_value, filterContext.getAuthnContextDeclRef()); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL AuthenticationMethodStringFactory(const std::pair& p) + { + return new AuthenticationMethodStringFunctor(p.second); + } + +}; diff --git a/shibsp/attribute/filtering/impl/ChainingAttributeFilter.cpp b/shibsp/attribute/filtering/impl/ChainingAttributeFilter.cpp new file mode 100644 index 0000000..f9ba21e --- /dev/null +++ b/shibsp/attribute/filtering/impl/ChainingAttributeFilter.cpp @@ -0,0 +1,90 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ChainingAttributeFilter.cpp + * + * Chains together multiple AttributeFilter plugins. + */ + +#include "internal.h" +#include "attribute/filtering/AttributeFilter.h" +#include "attribute/filtering/FilteringContext.h" + +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + class SHIBSP_DLLLOCAL ChainingAttributeFilter : public AttributeFilter + { + public: + ChainingAttributeFilter(const DOMElement* e); + virtual ~ChainingAttributeFilter() { + for_each(m_filters.begin(), m_filters.end(), xmltooling::cleanup()); + } + + Lockable* lock() { + return this; + } + void unlock() { + } + + void filterAttributes(const FilteringContext& context, vector& attributes) const { + for (vector::const_iterator i=m_filters.begin(); i!=m_filters.end(); ++i) { + Locker locker(*i); + (*i)->filterAttributes(context, attributes); + } + } + + private: + vector m_filters; + }; + + static const XMLCh _AttributeFilter[] = UNICODE_LITERAL_15(A,t,t,r,i,b,u,t,e,F,i,l,t,e,r); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + + AttributeFilter* SHIBSP_DLLLOCAL ChainingAttributeFilterFactory(const DOMElement* const & e) + { + return new ChainingAttributeFilter(e); + } +}; + +ChainingAttributeFilter::ChainingAttributeFilter(const DOMElement* e) +{ + SPConfig& conf = SPConfig::getConfig(); + + // Load up the chain of handlers. + e = e ? XMLHelper::getFirstChildElement(e, _AttributeFilter) : NULL; + while (e) { + auto_ptr_char type(e->getAttributeNS(NULL,_type)); + if (type.get() && *(type.get())) { + try { + m_filters.push_back(conf.AttributeFilterManager.newPlugin(type.get(),e)); + } + catch (exception& ex) { + Category::getInstance(SHIBSP_LOGCAT".AttributeFilter").error( + "caught exception processing embedded AttributeFilter element: %s", ex.what() + ); + } + } + e = XMLHelper::getNextSiblingElement(e, _AttributeFilter); + } +} diff --git a/shibsp/attribute/filtering/impl/MatchFunctor.cpp b/shibsp/attribute/filtering/impl/MatchFunctor.cpp new file mode 100644 index 0000000..06fd7b2 --- /dev/null +++ b/shibsp/attribute/filtering/impl/MatchFunctor.cpp @@ -0,0 +1,127 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * MatchFunctor.cpp + * + * A function that evaluates whether an expressed criteria is met by the current filter context. + */ + +#include "internal.h" +#include "attribute/filtering/MatchFunctor.h" +#include "util/SPConstants.h" + +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +#define DECL_FACTORY(name) \ + SHIBSP_DLLLOCAL PluginManager< MatchFunctor,QName,pair >::Factory name##Factory + +#define DECL_BASIC_QNAME(name,lit) \ + QName shibsp::name##Type(shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, lit) + +#define DECL_SAML_QNAME(name,lit) \ + QName shibsp::name##Type(shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS, lit) + +#define REGISTER_FACTORY(name) \ + mgr.registerFactory(name##Type, name##Factory) + +namespace shibsp { + DECL_FACTORY(AnyMatchFunctor); + DECL_FACTORY(AndMatchFunctor); + DECL_FACTORY(OrMatchFunctor); + DECL_FACTORY(NotMatchFunctor); + DECL_FACTORY(AttributeIssuerString); + DECL_FACTORY(AttributeRequesterString); + DECL_FACTORY(AuthenticationMethodString); + DECL_FACTORY(AttributeValueString); + DECL_FACTORY(AttributeScopeString); + DECL_FACTORY(AttributeIssuerRegex); + DECL_FACTORY(AttributeRequesterRegex); + DECL_FACTORY(AuthenticationMethodRegex); + DECL_FACTORY(AttributeValueRegex); + DECL_FACTORY(AttributeScopeRegex); + DECL_FACTORY(NumberOfAttributeValues); + DECL_FACTORY(AttributeIssuerInEntityGroup); + DECL_FACTORY(AttributeRequesterInEntityGroup); + DECL_FACTORY(AttributeScopeMatchesShibMDScope); + + + static const XMLCh ANY[] = UNICODE_LITERAL_3(A,N,Y); + static const XMLCh AND[] = UNICODE_LITERAL_3(A,N,D); + static const XMLCh OR[] = UNICODE_LITERAL_2(O,R); + static const XMLCh NOT[] = UNICODE_LITERAL_3(N,O,T); + static const XMLCh AttributeIssuerString[] = UNICODE_LITERAL_21(A,t,t,r,i,b,u,t,e,I,s,s,u,e,r,S,t,r,i,n,g); + static const XMLCh AttributeRequesterString[] = UNICODE_LITERAL_24(A,t,t,r,i,b,u,t,e,R,e,q,u,e,s,t,e,r,S,t,r,i,n,g); + static const XMLCh AuthenticationMethodString[] = UNICODE_LITERAL_26(A,u,t,h,e,n,t,i,c,a,t,i,o,n,M,e,t,h,o,d,S,t,r,i,n,g); + static const XMLCh AttributeValueString[] = UNICODE_LITERAL_20(A,t,t,r,i,b,u,t,e,V,a,l,u,e,S,t,r,i,n,g); + static const XMLCh AttributeScopeString[] = UNICODE_LITERAL_20(A,t,t,r,i,b,u,t,e,S,c,o,p,e,S,t,r,i,n,g); + static const XMLCh AttributeIssuerRegex[] = UNICODE_LITERAL_20(A,t,t,r,i,b,u,t,e,I,s,s,u,e,r,R,e,g,e,x); + static const XMLCh AttributeRequesterRegex[] = UNICODE_LITERAL_23(A,t,t,r,i,b,u,t,e,R,e,q,u,e,s,t,e,r,R,e,g,e,x); + static const XMLCh AuthenticationMethodRegex[] = UNICODE_LITERAL_25(A,u,t,h,e,n,t,i,c,a,t,i,o,n,M,e,t,h,o,d,R,e,g,e,x); + static const XMLCh AttributeValueRegex[] = UNICODE_LITERAL_19(A,t,t,r,i,b,u,t,e,V,a,l,u,e,R,e,g,e,x); + static const XMLCh AttributeScopeRegex[] = UNICODE_LITERAL_19(A,t,t,r,i,b,u,t,e,S,c,o,p,e,R,e,g,e,x); + static const XMLCh NumberOfAttributeValues[] = UNICODE_LITERAL_23(N,u,m,b,e,r,O,f,A,t,t,r,i,b,u,t,e,V,a,l,u,e,s); + static const XMLCh AttributeIssuerInEntityGroup[] = UNICODE_LITERAL_28(A,t,t,r,i,b,u,t,e,I,s,s,u,e,r,I,n,E,n,t,i,t,y,G,r,o,u,p); + static const XMLCh AttributeRequesterInEntityGroup[] = UNICODE_LITERAL_31(A,t,t,r,i,b,u,t,e,R,e,q,u,e,s,t,e,r,I,n,E,n,t,i,t,y,G,r,o,u,p); + static const XMLCh AttributeScopeMatchesShibMDScope[] = UNICODE_LITERAL_32(A,t,t,r,i,b,u,t,e,S,c,o,p,e,M,a,t,c,h,e,s,S,h,i,b,M,D,S,c,o,p,e); +}; + +DECL_BASIC_QNAME(AnyMatchFunctor, ANY); +DECL_BASIC_QNAME(AndMatchFunctor, AND); +DECL_BASIC_QNAME(OrMatchFunctor, OR); +DECL_BASIC_QNAME(NotMatchFunctor, NOT); +DECL_BASIC_QNAME(AttributeIssuerString, AttributeIssuerString); +DECL_BASIC_QNAME(AttributeRequesterString, AttributeRequesterString); +DECL_BASIC_QNAME(AuthenticationMethodString, AuthenticationMethodString); +DECL_BASIC_QNAME(AttributeValueString, AttributeValueString); +DECL_BASIC_QNAME(AttributeScopeString, AttributeScopeString); +DECL_BASIC_QNAME(AttributeIssuerRegex, AttributeIssuerRegex); +DECL_BASIC_QNAME(AttributeRequesterRegex, AttributeRequesterRegex); +DECL_BASIC_QNAME(AuthenticationMethodRegex, AuthenticationMethodRegex); +DECL_BASIC_QNAME(AttributeValueRegex, AttributeValueRegex); +DECL_BASIC_QNAME(AttributeScopeRegex, AttributeScopeRegex); +DECL_BASIC_QNAME(NumberOfAttributeValues, NumberOfAttributeValues); +DECL_SAML_QNAME(AttributeIssuerInEntityGroup, AttributeIssuerInEntityGroup); +DECL_SAML_QNAME(AttributeRequesterInEntityGroup, AttributeRequesterInEntityGroup); +DECL_SAML_QNAME(AttributeScopeMatchesShibMDScope, AttributeScopeMatchesShibMDScope); + +void SHIBSP_API shibsp::registerMatchFunctors() +{ + PluginManager< MatchFunctor,QName,pair >& mgr = + SPConfig::getConfig().MatchFunctorManager; + REGISTER_FACTORY(AnyMatchFunctor); + REGISTER_FACTORY(AndMatchFunctor); + REGISTER_FACTORY(OrMatchFunctor); + REGISTER_FACTORY(NotMatchFunctor); + REGISTER_FACTORY(AttributeIssuerString); + REGISTER_FACTORY(AttributeRequesterString); + REGISTER_FACTORY(AuthenticationMethodString); + REGISTER_FACTORY(AttributeValueString); + REGISTER_FACTORY(AttributeScopeString); + REGISTER_FACTORY(AttributeIssuerRegex); + REGISTER_FACTORY(AttributeRequesterRegex); + REGISTER_FACTORY(AuthenticationMethodRegex); + REGISTER_FACTORY(AttributeValueRegex); + REGISTER_FACTORY(AttributeScopeRegex); + REGISTER_FACTORY(NumberOfAttributeValues); + REGISTER_FACTORY(AttributeIssuerInEntityGroup); + REGISTER_FACTORY(AttributeRequesterInEntityGroup); + REGISTER_FACTORY(AttributeScopeMatchesShibMDScope); +} diff --git a/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp b/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp new file mode 100644 index 0000000..0f79a84 --- /dev/null +++ b/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp @@ -0,0 +1,109 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * NotMatchFunctor.cpp + * + * A MatchFunctor that negates the result of a contained functor. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilterPolicyContext.h" +#include "util/SPConstants.h" + +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + /** + * A MatchFunctor that negates the result of a contained functor. + */ + class SHIBSP_DLLLOCAL NotMatchFunctor : public MatchFunctor + { + public: + NotMatchFunctor(const pair& p); + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + if (m_functor) + return !(m_functor->evaluatePolicyRequirement(filterContext)); + return false; + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + if (m_functor) + return !(m_functor->evaluatePermitValue(filterContext, attribute, index)); + return false; + } + + private: + MatchFunctor* buildFunctor(const DOMElement* e, const FilterPolicyContext* functorMap); + + const MatchFunctor* m_functor; + }; + + MatchFunctor* SHIBSP_DLLLOCAL NotMatchFunctorFactory(const pair& p) + { + return new NotMatchFunctor(p); + } + + static XMLCh _id[] = UNICODE_LITERAL_2(i,d); + static XMLCh _ref[] = UNICODE_LITERAL_3(r,e,f); + static XMLCh Rule[] = UNICODE_LITERAL_4(R,u,l,e); + static XMLCh RuleReference[] = UNICODE_LITERAL_13(R,u,l,e,R,e,f,e,r,e,n,c,e); +}; + +NotMatchFunctor::NotMatchFunctor(const pair& p) : m_functor(NULL) +{ + const DOMElement* e = XMLHelper::getFirstChildElement(p.second); + if (e) { + if (XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, Rule)) { + m_functor = buildFunctor(e, p.first); + } + else if (XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, RuleReference)) { + auto_ptr_char ref(e->getAttributeNS(NULL, _ref)); + if (ref.get() && *ref.get()) { + multimap::const_iterator rule = p.first->getMatchFunctors().find(ref.get()); + m_functor = (rule!=p.first->getMatchFunctors().end()) ? rule->second : NULL; + } + } + } + + if (!m_functor) + throw ConfigurationException("No child Rule installed into NotMatchFunctor."); +} + +MatchFunctor* NotMatchFunctor::buildFunctor(const DOMElement* e, const FilterPolicyContext* functorMap) +{ + // We'll track and map IDs just for consistency, but don't require them or worry about dups. + auto_ptr_char temp(e->getAttributeNS(NULL,_id)); + const char* id = (temp.get() && *temp.get()) ? temp.get() : ""; + if (*id && functorMap->getMatchFunctors().count(id)) + id = ""; + + auto_ptr type(XMLHelper::getXSIType(e)); + if (!type.get()) + throw ConfigurationException("Child Rule found with no xsi:type."); + + MatchFunctor* func = SPConfig::getConfig().MatchFunctorManager.newPlugin(*type.get(), make_pair(functorMap,e)); + functorMap->getMatchFunctors().insert(multimap::value_type(id, func)); + return func; +} diff --git a/shibsp/attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp b/shibsp/attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp new file mode 100644 index 0000000..91d1106 --- /dev/null +++ b/shibsp/attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp @@ -0,0 +1,89 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * NumberOfAttributeValuesFunctor.cpp + * + * A match function that evaluates to true if the given attribute has as a number + * of values that falls between the minimum and maximum. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/FilteringContext.h" +#include "attribute/filtering/FilterPolicyContext.h" + +using namespace shibsp; +using namespace std; + +namespace shibsp { + + static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D); + static const XMLCh maximum[] = UNICODE_LITERAL_7(m,a,x,i,m,u,m); + static const XMLCh minimum[] = UNICODE_LITERAL_7(m,i,n,i,m,u,m); + + /** + * A match function that evaluates to true if the given attribute has as a number + * of values that falls between the minimum and maximum. + */ + class SHIBSP_DLLLOCAL NumberOfAttributeValuesFunctor : public MatchFunctor + { + unsigned int m_min,m_max; + xmltooling::auto_ptr_char m_attributeID; + + size_t count(const FilteringContext& filterContext) const; + + public: + NumberOfAttributeValuesFunctor(const DOMElement* e) + : m_min(0), m_max(INT_MAX), m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) { + if (!m_attributeID.get() || !*m_attributeID.get()) + throw ConfigurationException("No attributeID specified."); + const XMLCh* num = e->getAttributeNS(NULL, minimum); + if (num && *num) + m_min = XMLString::parseInt(num); + num = e->getAttributeNS(NULL, maximum); + if (num && *num) + m_max = XMLString::parseInt(num); + } + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + size_t c = count(filterContext); + return (m_min <= c && c <= m_max); + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + size_t c = count(filterContext); + return (m_min <= c && c <= m_max); + } + }; + + MatchFunctor* SHIBSP_DLLLOCAL NumberOfAttributeValuesFactory(const std::pair& p) + { + return new NumberOfAttributeValuesFunctor(p.second); + } + +}; + +size_t NumberOfAttributeValuesFunctor::count(const FilteringContext& filterContext) const +{ + size_t count = 0; + pair::const_iterator,multimap::const_iterator> attrs = + filterContext.getAttributes().equal_range(m_attributeID.get()); + for (; attrs.first != attrs.second; ++attrs.first) + count += attrs.first->second->valueCount(); + return count; +} diff --git a/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp b/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp new file mode 100644 index 0000000..cd29548 --- /dev/null +++ b/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp @@ -0,0 +1,115 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * OrMatchFunctor.cpp + * + * A MatchFunctor that logical ORs the results of contained functors. + */ + +#include "internal.h" +#include "exceptions.h" +#include "attribute/filtering/FilterPolicyContext.h" +#include "util/SPConstants.h" + +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + /** + * A MatchFunctor that logical ORs the results of contained functors. + */ + class SHIBSP_DLLLOCAL OrMatchFunctor : public MatchFunctor + { + public: + OrMatchFunctor(const pair& p); + + bool evaluatePolicyRequirement(const FilteringContext& filterContext) const { + for (vector::const_iterator mf = m_functors.begin(); mf!=m_functors.end(); ++mf) + if ((*mf)->evaluatePolicyRequirement(filterContext)) + return true; + return false; + } + + bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const { + for (vector::const_iterator mf = m_functors.begin(); mf!=m_functors.end(); ++mf) + if ((*mf)->evaluatePermitValue(filterContext, attribute, index)) + return true; + return false; + } + + private: + MatchFunctor* buildFunctor(const DOMElement* e, const FilterPolicyContext* functorMap); + + vector m_functors; + }; + + MatchFunctor* SHIBSP_DLLLOCAL OrMatchFunctorFactory(const pair& p) + { + return new OrMatchFunctor(p); + } + + static XMLCh _id[] = UNICODE_LITERAL_2(i,d); + static XMLCh _ref[] = UNICODE_LITERAL_3(r,e,f); + static XMLCh Rule[] = UNICODE_LITERAL_4(R,u,l,e); + static XMLCh RuleReference[] = UNICODE_LITERAL_13(R,u,l,e,R,e,f,e,r,e,n,c,e); +}; + +OrMatchFunctor::OrMatchFunctor(const pair& p) +{ + MatchFunctor* func; + const DOMElement* e = XMLHelper::getFirstChildElement(p.second); + while (e) { + func = NULL; + if (XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, Rule)) { + func = buildFunctor(e, p.first); + } + else if (XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, RuleReference)) { + auto_ptr_char ref(e->getAttributeNS(NULL, _ref)); + if (ref.get() && *ref.get()) { + multimap::const_iterator rule = p.first->getMatchFunctors().find(ref.get()); + func = (rule!=p.first->getMatchFunctors().end()) ? rule->second : NULL; + } + } + + if (func) + m_functors.push_back(func); + + e = XMLHelper::getNextSiblingElement(e); + } +} + +MatchFunctor* OrMatchFunctor::buildFunctor(const DOMElement* e, const FilterPolicyContext* functorMap) +{ + // We'll track and map IDs just for consistency, but don't require them or worry about dups. + auto_ptr_char temp(e->getAttributeNS(NULL,_id)); + const char* id = (temp.get() && *temp.get()) ? temp.get() : ""; + if (*id && functorMap->getMatchFunctors().count(id)) + id = ""; + + auto_ptr type(XMLHelper::getXSIType(e)); + if (!type.get()) + throw ConfigurationException("Child Rule found with no xsi:type."); + + MatchFunctor* func = SPConfig::getConfig().MatchFunctorManager.newPlugin(*type.get(), make_pair(functorMap,e)); + functorMap->getMatchFunctors().insert(multimap::value_type(id, func)); + return func; +} diff --git a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp new file mode 100644 index 0000000..47857f2 --- /dev/null +++ b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp @@ -0,0 +1,397 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * XMLAttributeFilter.cpp + * + * AttributeFilter based on an XML policy language. + */ + +#include "internal.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/AttributeFilter.h" +#include "attribute/filtering/FilterPolicyContext.h" +#include "util/SPConstants.h" + +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + struct SHIBSP_DLLLOCAL Policy + { + Policy() : m_applies(NULL) {} + const MatchFunctor* m_applies; + typedef multimap rules_t; + rules_t m_rules; + }; + + class SHIBSP_DLLLOCAL XMLFilterImpl + { + public: + XMLFilterImpl(const DOMElement* e, Category& log); + ~XMLFilterImpl() { + if (m_document) + m_document->release(); + for_each(m_policyReqRules.begin(), m_policyReqRules.end(), cleanup_pair()); + for_each(m_permitValRules.begin(), m_permitValRules.end(), cleanup_pair()); + } + + void setDocument(DOMDocument* doc) { + m_document = doc; + } + + void filterAttributes(const FilteringContext& context, vector& attributes) const; + + private: + MatchFunctor* buildFunctor( + const DOMElement* e, const FilterPolicyContext& functorMap, const char* logname, bool standalone + ); + pair buildAttributeRule(const DOMElement* e, const FilterPolicyContext& functorMap, bool standalone); + + Category& m_log; + DOMDocument* m_document; + vector m_policies; + map< string,pair > m_attrRules; + multimap m_policyReqRules; + multimap m_permitValRules; + }; + + class SHIBSP_DLLLOCAL XMLFilter : public AttributeFilter, public ReloadableXMLFile + { + public: + XMLFilter(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".AttributeFilter")), m_impl(NULL) { + load(); + } + ~XMLFilter() { + delete m_impl; + } + + void filterAttributes(const FilteringContext& context, vector& attributes) const { + m_impl->filterAttributes(context, attributes); + } + + protected: + pair load(); + + private: + XMLFilterImpl* m_impl; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + AttributeFilter* SHIBSP_DLLLOCAL XMLAttributeFilterFactory(const DOMElement* const & e) + { + return new XMLFilter(e); + } + + static const XMLCh AttributeFilterPolicyGroup[] = UNICODE_LITERAL_26(A,t,t,r,i,b,u,t,e,F,i,l,t,e,r,P,o,l,i,c,y,G,r,o,u,p); + static const XMLCh AttributeFilterPolicy[] = UNICODE_LITERAL_21(A,t,t,r,i,b,u,t,e,F,i,l,t,e,r,P,o,l,i,c,y); + static const XMLCh AttributeRule[] = UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,R,u,l,e); + static const XMLCh AttributeRuleReference[] = UNICODE_LITERAL_22(A,t,t,r,i,b,u,t,e,R,u,l,e,R,e,f,e,r,e,n,c,e); + static const XMLCh PermitValueRule[] = UNICODE_LITERAL_15(P,e,r,m,i,t,V,a,l,u,e,R,u,l,e); + static const XMLCh PermitValueRuleReference[] = UNICODE_LITERAL_24(P,e,r,m,i,t,V,a,l,u,e,R,u,l,e,R,e,f,e,r,e,n,c,e); + static const XMLCh PolicyRequirementRule[] = UNICODE_LITERAL_21(P,o,l,i,c,y,R,e,q,u,i,r,e,m,e,n,t,R,u,l,e); + static const XMLCh PolicyRequirementRuleReference[]=UNICODE_LITERAL_30(P,o,l,i,c,y,R,e,q,u,i,r,e,m,e,n,t,R,u,l,e,R,e,f,e,r,e,n,c,e); + static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D); + static const XMLCh _id[] = UNICODE_LITERAL_2(i,d); + static const XMLCh _ref[] = UNICODE_LITERAL_3(r,e,f); +}; + +XMLFilterImpl::XMLFilterImpl(const DOMElement* e, Category& log) : m_log(log), m_document(NULL) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("XMLFilterImpl"); +#endif + + if (!XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeFilterPolicyGroup)) + throw ConfigurationException("XML AttributeFilter requires afp:AttributeFilterPolicyGroup at root of configuration."); + + FilterPolicyContext reqFunctors(m_policyReqRules); + FilterPolicyContext valFunctors(m_permitValRules); + + DOMElement* child = XMLHelper::getFirstChildElement(e); + while (child) { + if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRule)) { + buildFunctor(child, reqFunctors, "PolicyRequirementRule", true); + } + else if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PermitValueRule)) { + buildFunctor(child, valFunctors, "PermitValueRule", true); + } + else if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) { + buildAttributeRule(child, valFunctors, true); + } + else if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeFilterPolicy)) { + e = XMLHelper::getFirstChildElement(child); + MatchFunctor* func = NULL; + if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRule)) { + func = buildFunctor(e, reqFunctors, "PolicyRequirementRule", false); + } + else if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRuleReference)) { + auto_ptr_char ref(e->getAttributeNS(NULL, _ref)); + if (ref.get() && *ref.get()) { + multimap::const_iterator prr = m_policyReqRules.find(ref.get()); + func = (prr!=m_policyReqRules.end()) ? prr->second : NULL; + } + } + if (func) { + m_policies.push_back(Policy()); + m_policies.back().m_applies = func; + e = XMLHelper::getNextSiblingElement(e); + while (e) { + if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) { + pair rule = buildAttributeRule(e, valFunctors, false); + if (rule.second) + m_policies.back().m_rules.insert(Policy::rules_t::value_type(rule.first, rule.second)); + } + else if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeRuleReference)) { + auto_ptr_char ref(e->getAttributeNS(NULL, _ref)); + if (ref.get() && *ref.get()) { + map< string,pair >::const_iterator ar = m_attrRules.find(ref.get()); + if (ar != m_attrRules.end()) + m_policies.back().m_rules.insert(Policy::rules_t::value_type(ar->second.first, ar->second.second)); + else + m_log.warn("skipping invalid AttributeRuleReference (%s)", ref.get()); + } + } + e = XMLHelper::getNextSiblingElement(e); + } + } + else { + m_log.warn("skipping AttributeFilterPolicy, PolicyRequirementRule invalid or missing"); + } + } + child = XMLHelper::getNextSiblingElement(child); + } +} + +MatchFunctor* XMLFilterImpl::buildFunctor( + const DOMElement* e, const FilterPolicyContext& functorMap, const char* logname, bool standalone + ) +{ + auto_ptr_char temp(e->getAttributeNS(NULL,_id)); + const char* id = (temp.get() && *temp.get()) ? temp.get() : ""; + + if (standalone && !*id) { + m_log.warn("skipping stand-alone %s with no id", logname); + return NULL; + } + else if (*id && functorMap.getMatchFunctors().count(id)) { + if (standalone) { + m_log.warn("skipping duplicate stand-alone %s with id (%s)", logname, id); + return NULL; + } + else + id = ""; + } + + auto_ptr type(XMLHelper::getXSIType(e)); + if (type.get()) { + try { + MatchFunctor* func = SPConfig::getConfig().MatchFunctorManager.newPlugin(*type.get(), make_pair(&functorMap,e)); + functorMap.getMatchFunctors().insert(multimap::value_type(id, func)); + return func; + } + catch (exception& ex) { + m_log.error("error building %s with type (%s): %s", logname, type->toString().c_str(), ex.what()); + } + } + else if (standalone) + m_log.warn("skipping stand-alone %s with no xsi:type", logname); + else + m_log.error("%s with no xsi:type", logname); + + return NULL; +} + +pair XMLFilterImpl::buildAttributeRule(const DOMElement* e, const FilterPolicyContext& functorMap, bool standalone) +{ + auto_ptr_char temp(e->getAttributeNS(NULL,_id)); + const char* id = (temp.get() && *temp.get()) ? temp.get() : ""; + + if (standalone && !*id) { + m_log.warn("skipping stand-alone AttributeRule with no id"); + return make_pair(string(),(const MatchFunctor*)NULL); + } + else if (*id && m_attrRules.count(id)) { + if (standalone) { + m_log.warn("skipping duplicate stand-alone AttributeRule with id (%s)", id); + return make_pair(string(),(const MatchFunctor*)NULL); + } + else + id = ""; + } + + auto_ptr_char attrID(e->getAttributeNS(NULL,attributeID)); + if (!attrID.get() || !*attrID.get()) + m_log.warn("skipping AttributeRule with no attributeID"); + + e = XMLHelper::getFirstChildElement(e); + MatchFunctor* func=NULL; + if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PermitValueRule)) { + func = buildFunctor(e, functorMap, "PermitValueRule", false); + } + else if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PermitValueRuleReference)) { + auto_ptr_char ref(e->getAttributeNS(NULL, _ref)); + if (ref.get() && *ref.get()) { + multimap::const_iterator pvr = m_permitValRules.find(ref.get()); + func = (pvr!=m_permitValRules.end()) ? pvr->second : NULL; + } + } + + if (func) { + if (*id) + return m_attrRules[id] = pair(attrID.get(), func); + else + return pair(attrID.get(), func); + } + + m_log.warn("skipping AttributeRule (%s), PermitValueRule invalid or missing", id); + return make_pair(string(),(const MatchFunctor*)NULL); +} + +void XMLFilterImpl::filterAttributes(const FilteringContext& context, vector& attributes) const +{ + auto_ptr_char issuer(context.getAttributeIssuer()); + + m_log.debug("filtering %lu attribute(s) from (%s)", attributes.size(), issuer.get() ? issuer.get() : "unknown source"); + + if (m_policies.empty()) { + m_log.warn("no filter policies were loaded, filtering out all attributes from (%s)", issuer.get() ? issuer.get() : "unknown source"); + for_each(attributes.begin(), attributes.end(), xmltooling::cleanup()); + attributes.clear(); + return; + } + + size_t count,index; + + // Test each Policy. + for (vector::const_iterator p=m_policies.begin(); p!=m_policies.end(); ++p) { + if (p->m_applies->evaluatePolicyRequirement(context)) { + // Loop over the attributes and look for possible rules to run. + for (vector::size_type a=0; a rules = p->m_rules.equal_range(attr->getId()); + if (rules.first != rules.second) { + ruleFound = true; + // Run each rule in sequence. + m_log.debug( + "applying filtering rule(s) for attribute (%s) from (%s)", + attr->getId(), issuer.get() ? issuer.get() : "unknown source" + ); + for (; rules.first!=rules.second; ++rules.first) { + count = attr->valueCount(); + for (index=0; index < count;) { + // The return value tells us whether to index past the accepted value, or stay put and decrement the count. + if (rules.first->second->evaluatePermitValue(context, *attr, index)) { + index++; + } + else { + m_log.warn( + "removed value at position (%lu) of attribute (%s) from (%s)", + index, attr->getId(), issuer.get() ? issuer.get() : "unknown source" + ); + attr->removeValue(index); + count--; + } + } + } + } + + rules = p->m_rules.equal_range("*"); + if (rules.first != rules.second) { + // Run each rule in sequence. + if (!ruleFound) { + m_log.debug( + "applying wildcard rule(s) for attribute (%s) from (%s)", + attr->getId(), issuer.get() ? issuer.get() : "unknown source" + ); + ruleFound = true; + } + for (; rules.first!=rules.second; ++rules.first) { + count = attr->valueCount(); + for (index=0; index < count;) { + // The return value tells us whether to index past the accepted value, or stay put and decrement the count. + if (rules.first->second->evaluatePermitValue(context, *attr, index)) { + index++; + } + else { + m_log.warn( + "removed value at position (%lu) of attribute (%s) from (%s)", + index, attr->getId(), issuer.get() ? issuer.get() : "unknown source" + ); + attr->removeValue(index); + count--; + } + } + } + } + + if (!ruleFound || attr->valueCount() == 0) { + if (!ruleFound) { + // No rule found, so we're filtering it out. + m_log.warn( + "no rule found, removing all values of attribute (%s) from (%s)", + attr->getId(), issuer.get() ? issuer.get() : "unknown source" + ); + } + delete attr; + attributes.erase(attributes.begin() + a); + } + else { + ++a; + } + } + } + } +} + +pair XMLFilter::load() +{ + // Load from source using base class. + pair raw = ReloadableXMLFile::load(); + + // If we own it, wrap it. + XercesJanitor docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL); + + XMLFilterImpl* impl = new XMLFilterImpl(raw.second, m_log); + + // If we held the document, transfer it to the impl. If we didn't, it's a no-op. + impl->setDocument(docjanitor.release()); + + delete m_impl; + m_impl = impl; + + return make_pair(false,(DOMElement*)NULL); +} diff --git a/shibsp/attribute/resolver/AttributeExtractor.h b/shibsp/attribute/resolver/AttributeExtractor.h new file mode 100644 index 0000000..a0b0a14 --- /dev/null +++ b/shibsp/attribute/resolver/AttributeExtractor.h @@ -0,0 +1,83 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/resolver/AttributeExtractor.h + * + * A service that extracts and decodes attributes from XML objects. + */ + +#ifndef __shibsp_extractor_h__ +#define __shibsp_extractor_h__ + +#include +#include +#include + +namespace shibsp { + + class SHIBSP_API Application; + class SHIBSP_API Attribute; + + /** + * A service that extracts and decodes attributes from XML objects. + */ + class SHIBSP_API AttributeExtractor : public virtual xmltooling::Lockable + { + MAKE_NONCOPYABLE(AttributeExtractor); + protected: + AttributeExtractor() {} + public: + virtual ~AttributeExtractor() {} + + /** + * Extracts the attributes found in an XMLObject. + * + * @param application Application performing the extraction + * @param issuer source of object, if known + * @param xmlObject object to extract + * @param attributes an array to populate with the extracted attributes + * + * @throws AttributeExtractionException thrown if there is a problem extracting attributes + */ + virtual void extractAttributes( + const Application& application, + const opensaml::saml2md::RoleDescriptor* issuer, + const xmltooling::XMLObject& xmlObject, + std::vector& attributes + ) const=0; + + /** + * Populates an array with the set of Attribute IDs that might be generated. + * + * @param attributes array to populate + */ + virtual void getAttributeIds(std::vector& attributes) const=0; + }; + + /** + * Registers AttributeExtractor classes into the runtime. + */ + void SHIBSP_API registerAttributeExtractors(); + + /** AttributeExtractor based on an XML mapping schema. */ + #define XML_ATTRIBUTE_EXTRACTOR "XML" + + /** AttributeExtractor based on chaining together other extractors. */ + #define CHAINING_ATTRIBUTE_EXTRACTOR "Chaining" +}; + +#endif /* __shibsp_extractor_h__ */ diff --git a/shibsp/attribute/resolver/AttributeResolver.h b/shibsp/attribute/resolver/AttributeResolver.h new file mode 100644 index 0000000..73adab1 --- /dev/null +++ b/shibsp/attribute/resolver/AttributeResolver.h @@ -0,0 +1,125 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/resolver/AttributeResolver.h + * + * A service that transforms or resolves additional attributes for a particular subject. + */ + +#ifndef __shibsp_resolver_h__ +#define __shibsp_resolver_h__ + +#include + +#include +#include +#include + +namespace shibsp { + + class SHIBSP_API Application; + class SHIBSP_API Attribute; + class SHIBSP_API Session; + class SHIBSP_API ResolutionContext; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 4251 ) +#endif + + /** + * The service that resolves the attributes for a particular subject. + */ + class SHIBSP_API AttributeResolver : public virtual xmltooling::Lockable + { + MAKE_NONCOPYABLE(AttributeResolver); + protected: + AttributeResolver() {} + public: + virtual ~AttributeResolver() {} + + /** + * Creates a ResolutionContext based on session bootstrap material. + * + *

This enables resolution to occur ahead of session creation so that + * Attributes can be supplied while creating the session. + * + * @param application reference to Application that owns the eventual Session + * @param issuer issuing metadata of assertion issuer, if known + * @param protocol protocol used to establish Session + * @param nameid principal identifier, normalized to SAML 2, if any + * @param authncontext_class method/category of authentication event, if known + * @param authncontext_decl specifics of authentication event, if known + * @param tokens assertions initiating the Session, if any + * @param attributes array of previously resolved attributes, if any + * @return newly created ResolutionContext, owned by caller + */ + virtual ResolutionContext* createResolutionContext( + const Application& application, + const opensaml::saml2md::EntityDescriptor* issuer, + const XMLCh* protocol, + const opensaml::saml2::NameID* nameid=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL, + const std::vector* tokens=NULL, + const std::vector* attributes=NULL + ) const=0; + + /** + * Creates a ResolutionContext for an existing Session. + * + * @param application reference to Application that owns the Session + * @param session reference to Session + * @return newly created ResolutionContext, owned by caller + */ + virtual ResolutionContext* createResolutionContext(const Application& application, const Session& session) const=0; + + + /** + * Resolves attributes for a given subject and returns them in the supplied context. + * + * @param ctx resolution context to use to resolve attributes + * + * @throws AttributeResolutionException thrown if there is a problem resolving the attributes for the subject + */ + virtual void resolveAttributes(ResolutionContext& ctx) const=0; + + /** + * Populates an array with the set of Attribute IDs that might be generated. + * + * @param attributes array to populate + */ + virtual void getAttributeIds(std::vector& attributes) const=0; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + /** + * Registers AttributeResolver classes into the runtime. + */ + void SHIBSP_API registerAttributeResolvers(); + + /** AttributeResolver based on SAML queries to an IdP during SSO. */ + #define QUERY_ATTRIBUTE_RESOLVER "Query" + + /** AttributeResolver based on chaining together other resolvers. */ + #define CHAINING_ATTRIBUTE_RESOLVER "Chaining" +}; + +#endif /* __shibsp_resolver_h__ */ diff --git a/shibsp/attribute/resolver/ResolutionContext.h b/shibsp/attribute/resolver/ResolutionContext.h new file mode 100644 index 0000000..760246a --- /dev/null +++ b/shibsp/attribute/resolver/ResolutionContext.h @@ -0,0 +1,69 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/attribute/resolver/ResolutionContext.h + * + * A context for a resolution request. + */ + +#ifndef __shibsp_resctx_h__ +#define __shibsp_resctx_h__ + +#include + +#include + +namespace shibsp { + + class SHIBSP_API Attribute; + + /** + * A context for a resolution request. + */ + class SHIBSP_API ResolutionContext + { + MAKE_NONCOPYABLE(ResolutionContext); + protected: + ResolutionContext() {} + public: + virtual ~ResolutionContext() {} + + /** + * Returns the set of Attributes resolved and added to the context. + * + *

Any Attributes left in the returned container will be freed by the + * context, so the caller should modify/clear the container after copying + * objects for its own use. + * + * @return a mutable array of Attributes. + */ + virtual std::vector& getResolvedAttributes()=0; + + /** + * Returns the set of assertions resolved and added to the context. + * + *

Any assertions left in the returned container will be freed by the + * context, so the caller should modify/clear the container after copying + * objects for its own use. + * + * @return a mutable array of Assertions + */ + virtual std::vector& getResolvedAssertions()=0; + }; +}; + +#endif /* __shibsp_resctx_h__ */ diff --git a/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp new file mode 100644 index 0000000..6c23764 --- /dev/null +++ b/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp @@ -0,0 +1,117 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ChainingAttributeExtractor.cpp + * + * Chains together multiple AttributeExtractor plugins. + */ + +#include "internal.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "attribute/Attribute.h" +#include "attribute/resolver/AttributeExtractor.h" + +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + class SHIBSP_DLLLOCAL ChainingAttributeExtractor : public AttributeExtractor + { + public: + ChainingAttributeExtractor(const DOMElement* e); + virtual ~ChainingAttributeExtractor() { + for_each(m_extractors.begin(), m_extractors.end(), xmltooling::cleanup()); + } + + Lockable* lock() { + return this; + } + void unlock() { + } + + void extractAttributes( + const Application& application, + const RoleDescriptor* issuer, + const XMLObject& xmlObject, + vector& attributes + ) const; + + void getAttributeIds(vector& attributes) const { + for (vector::const_iterator i=m_extractors.begin(); i!=m_extractors.end(); ++i) { + Locker locker(*i); + (*i)->getAttributeIds(attributes); + } + } + + private: + vector m_extractors; + }; + + static const XMLCh _AttributeExtractor[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,E,x,t,r,a,c,t,o,r); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + + SHIBSP_DLLLOCAL PluginManager::Factory XMLAttributeExtractorFactory; + AttributeExtractor* SHIBSP_DLLLOCAL ChainingExtractorFactory(const DOMElement* const & e) + { + return new ChainingAttributeExtractor(e); + } +}; + +void SHIBSP_API shibsp::registerAttributeExtractors() +{ + SPConfig::getConfig().AttributeExtractorManager.registerFactory(XML_ATTRIBUTE_EXTRACTOR, XMLAttributeExtractorFactory); + SPConfig::getConfig().AttributeExtractorManager.registerFactory(CHAINING_ATTRIBUTE_EXTRACTOR, ChainingExtractorFactory); +} + +ChainingAttributeExtractor::ChainingAttributeExtractor(const DOMElement* e) +{ + SPConfig& conf = SPConfig::getConfig(); + + // Load up the chain of handlers. + e = e ? XMLHelper::getFirstChildElement(e, _AttributeExtractor) : NULL; + while (e) { + auto_ptr_char type(e->getAttributeNS(NULL,_type)); + if (type.get() && *(type.get())) { + try { + m_extractors.push_back(conf.AttributeExtractorManager.newPlugin(type.get(),e)); + } + catch (exception& ex) { + Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor").error( + "caught exception processing embedded AttributeExtractor element: %s", ex.what() + ); + } + } + e = XMLHelper::getNextSiblingElement(e, _AttributeExtractor); + } +} + +void ChainingAttributeExtractor::extractAttributes( + const Application& application, const RoleDescriptor* issuer, const XMLObject& xmlObject, vector& attributes + ) const +{ + for (vector::const_iterator i=m_extractors.begin(); i!=m_extractors.end(); ++i) { + Locker locker(*i); + (*i)->extractAttributes(application, issuer, xmlObject, attributes); + } +} diff --git a/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp b/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp new file mode 100644 index 0000000..c1b3805 --- /dev/null +++ b/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp @@ -0,0 +1,194 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ChainingAttributeResolver.cpp + * + * Chains together multiple AttributeResolver plugins. + */ + +#include "internal.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "attribute/Attribute.h" +#include "attribute/resolver/AttributeResolver.h" +#include "attribute/resolver/ResolutionContext.h" + +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2; +using namespace opensaml::saml2md; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + struct SHIBSP_DLLLOCAL ChainingContext : public ResolutionContext + { + ChainingContext( + const Application& application, + const EntityDescriptor* issuer, + const XMLCh* protocol, + const NameID* nameid, + const XMLCh* authncontext_class, + const XMLCh* authncontext_decl, + const vector* tokens, + const vector* attributes + ) : m_app(application), m_issuer(issuer), m_protocol(protocol), m_nameid(nameid), m_authclass(authncontext_class), m_authdecl(authncontext_decl), m_session(NULL) { + if (tokens) + m_tokens.assign(tokens->begin(), tokens->end()); + if (attributes) + m_attributes.assign(attributes->begin(), attributes->end()); + } + + ChainingContext(const Application& application, const Session& session) : m_app(application), m_session(&session) { + } + + ~ChainingContext() { + for_each(m_ownedAttributes.begin(), m_ownedAttributes.end(), xmltooling::cleanup()); + for_each(m_ownedAssertions.begin(), m_ownedAssertions.end(), xmltooling::cleanup()); + } + + vector& getResolvedAttributes() { + return m_ownedAttributes; + } + vector& getResolvedAssertions() { + return m_ownedAssertions; + } + + vector m_ownedAttributes; + vector m_ownedAssertions; + + const Application& m_app; + const EntityDescriptor* m_issuer; + const XMLCh* m_protocol; + const NameID* m_nameid; + const XMLCh* m_authclass; + const XMLCh* m_authdecl; + vector m_tokens; + vector m_attributes; + + const Session* m_session; + }; + + class SHIBSP_DLLLOCAL ChainingAttributeResolver : public AttributeResolver + { + public: + ChainingAttributeResolver(const DOMElement* e); + virtual ~ChainingAttributeResolver() { + for_each(m_resolvers.begin(), m_resolvers.end(), xmltooling::cleanup()); + } + + Lockable* lock() { + return this; + } + void unlock() { + } + + ResolutionContext* createResolutionContext( + const Application& application, + const EntityDescriptor* issuer, + const XMLCh* protocol, + const NameID* nameid=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL, + const vector* tokens=NULL, + const vector* attributes=NULL + ) const { + return new ChainingContext(application, issuer, protocol, nameid, authncontext_class, authncontext_decl, tokens, attributes); + } + + ResolutionContext* createResolutionContext(const Application& application, const Session& session) const { + return new ChainingContext(application, session); + } + + void resolveAttributes(ResolutionContext& ctx) const; + + void getAttributeIds(vector& attributes) const { + for (vector::const_iterator i=m_resolvers.begin(); i!=m_resolvers.end(); ++i) { + Locker locker(*i); + (*i)->getAttributeIds(attributes); + } + } + + private: + vector m_resolvers; + }; + + static const XMLCh _AttributeResolver[] = UNICODE_LITERAL_17(A,t,t,r,i,b,u,t,e,R,e,s,o,l,v,e,r); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + + SHIBSP_DLLLOCAL PluginManager::Factory QueryResolverFactory; + AttributeResolver* SHIBSP_DLLLOCAL ChainingResolverFactory(const DOMElement* const & e) + { + return new ChainingAttributeResolver(e); + } +}; + +void SHIBSP_API shibsp::registerAttributeResolvers() +{ + SPConfig::getConfig().AttributeResolverManager.registerFactory(QUERY_ATTRIBUTE_RESOLVER, QueryResolverFactory); + SPConfig::getConfig().AttributeResolverManager.registerFactory(CHAINING_ATTRIBUTE_RESOLVER, ChainingResolverFactory); +} + +ChainingAttributeResolver::ChainingAttributeResolver(const DOMElement* e) +{ + SPConfig& conf = SPConfig::getConfig(); + + // Load up the chain of handlers. + e = e ? XMLHelper::getFirstChildElement(e, _AttributeResolver) : NULL; + while (e) { + auto_ptr_char type(e->getAttributeNS(NULL,_type)); + if (type.get() && *(type.get())) { + try { + m_resolvers.push_back(conf.AttributeResolverManager.newPlugin(type.get(),e)); + } + catch (exception& ex) { + Category::getInstance(SHIBSP_LOGCAT".AttributeResolver").error( + "caught exception processing embedded AttributeResolver element: %s", ex.what() + ); + } + } + e = XMLHelper::getNextSiblingElement(e, _AttributeResolver); + } +} + +void ChainingAttributeResolver::resolveAttributes(ResolutionContext& ctx) const +{ + ChainingContext& chain = dynamic_cast(ctx); + for (vector::const_iterator i=m_resolvers.begin(); i!=m_resolvers.end(); ++i) { + Locker locker(*i); + auto_ptr context( + chain.m_session ? + (*i)->createResolutionContext(chain.m_app, *chain.m_session) : + (*i)->createResolutionContext( + chain.m_app, chain.m_issuer, chain.m_protocol, chain.m_nameid, chain.m_authclass, chain.m_authdecl, &chain.m_tokens, &chain.m_attributes + ) + ); + + (*i)->resolveAttributes(*context.get()); + + chain.m_attributes.insert(chain.m_attributes.end(), context->getResolvedAttributes().begin(), context->getResolvedAttributes().end()); + chain.m_ownedAttributes.insert(chain.m_attributes.end(), context->getResolvedAttributes().begin(), context->getResolvedAttributes().end()); + context->getResolvedAttributes().clear(); + + chain.m_tokens.insert(chain.m_tokens.end(), context->getResolvedAssertions().begin(), context->getResolvedAssertions().end()); + chain.m_ownedAssertions.insert(chain.m_ownedAssertions.end(), context->getResolvedAssertions().begin(), context->getResolvedAssertions().end()); + context->getResolvedAssertions().clear(); + } +} diff --git a/shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp b/shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp new file mode 100644 index 0000000..04ad7bd --- /dev/null +++ b/shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp @@ -0,0 +1,562 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * QueryAttributeResolver.cpp + * + * AttributeResolver based on SAML queries. + */ + +#include "internal.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "attribute/Attribute.h" +#include "attribute/filtering/AttributeFilter.h" +#include "attribute/filtering/BasicFilteringContext.h" +#include "attribute/resolver/AttributeExtractor.h" +#include "attribute/resolver/AttributeResolver.h" +#include "attribute/resolver/ResolutionContext.h" +#include "binding/SOAPClient.h" +#include "util/SPConstants.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml1; +using namespace opensaml::saml1p; +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + class SHIBSP_DLLLOCAL QueryContext : public ResolutionContext + { + public: + QueryContext(const Application& application, const Session& session) + : m_query(true), m_app(application), m_session(&session), m_metadata(NULL), m_entity(NULL), m_nameid(NULL) { + m_protocol = XMLString::transcode(session.getProtocol()); + m_class = XMLString::transcode(session.getAuthnContextClassRef()); + m_decl = XMLString::transcode(session.getAuthnContextDeclRef()); + } + + QueryContext( + const Application& application, + const EntityDescriptor* issuer, + const XMLCh* protocol, + const NameID* nameid=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL, + const vector* tokens=NULL, + const vector* attributes=NULL + ) : m_query(true), m_app(application), m_session(NULL), m_metadata(NULL), m_entity(issuer), + m_protocol(protocol), m_nameid(nameid), m_class(authncontext_class), m_decl(authncontext_decl) { + + if (tokens) { + for (vector::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) { + const saml2::Assertion* token2 = dynamic_cast(*t); + if (token2 && !token2->getAttributeStatements().empty()) { + m_query = false; + } + else { + const saml1::Assertion* token1 = dynamic_cast(*t); + if (token1 && !token1->getAttributeStatements().empty()) { + m_query = false; + } + } + } + } + } + + ~QueryContext() { + if (m_session) { + XMLString::release((XMLCh**)&m_protocol); + XMLString::release((XMLCh**)&m_class); + XMLString::release((XMLCh**)&m_decl); + } + if (m_metadata) + m_metadata->unlock(); + for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup()); + for_each(m_assertions.begin(), m_assertions.end(), xmltooling::cleanup()); + } + + bool doQuery() const { + return m_query; + } + + const Application& getApplication() const { + return m_app; + } + const EntityDescriptor* getEntityDescriptor() const { + if (m_entity) + return m_entity; + if (m_session && m_session->getEntityID()) { + m_metadata = m_app.getMetadataProvider(false); + if (m_metadata) { + m_metadata->lock(); + return m_entity = m_metadata->getEntityDescriptor(MetadataProvider::Criteria(m_session->getEntityID())).first; + } + } + return NULL; + } + const XMLCh* getProtocol() const { + return m_protocol; + } + const NameID* getNameID() const { + return m_session ? m_session->getNameID() : m_nameid; + } + const XMLCh* getClassRef() const { + return m_class; + } + const XMLCh* getDeclRef() const { + return m_decl; + } + const Session* getSession() const { + return m_session; + } + vector& getResolvedAttributes() { + return m_attributes; + } + vector& getResolvedAssertions() { + return m_assertions; + } + + private: + bool m_query; + const Application& m_app; + const Session* m_session; + mutable MetadataProvider* m_metadata; + mutable const EntityDescriptor* m_entity; + const XMLCh* m_protocol; + const NameID* m_nameid; + const XMLCh* m_class; + const XMLCh* m_decl; + vector m_attributes; + vector m_assertions; + }; + + class SHIBSP_DLLLOCAL QueryResolver : public AttributeResolver + { + public: + QueryResolver(const DOMElement* e); + ~QueryResolver() { + for_each(m_SAML1Designators.begin(), m_SAML1Designators.end(), xmltooling::cleanup()); + for_each(m_SAML2Designators.begin(), m_SAML2Designators.end(), xmltooling::cleanup()); + } + + Lockable* lock() {return this;} + void unlock() {} + + ResolutionContext* createResolutionContext( + const Application& application, + const EntityDescriptor* issuer, + const XMLCh* protocol, + const NameID* nameid=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL, + const vector* tokens=NULL, + const vector* attributes=NULL + ) const { + return new QueryContext(application,issuer,protocol,nameid,authncontext_class,authncontext_decl,tokens,attributes); + } + + ResolutionContext* createResolutionContext(const Application& application, const Session& session) const { + return new QueryContext(application,session); + } + + void resolveAttributes(ResolutionContext& ctx) const; + + void getAttributeIds(vector& attributes) const { + // Nothing to do, only the extractor would actually generate them. + } + + private: + bool SAML1Query(QueryContext& ctx) const; + bool SAML2Query(QueryContext& ctx) const; + + Category& m_log; + vector m_SAML1Designators; + vector m_SAML2Designators; + }; + + AttributeResolver* SHIBSP_DLLLOCAL QueryResolverFactory(const DOMElement* const & e) + { + return new QueryResolver(e); + } + +}; + +QueryResolver::QueryResolver(const DOMElement* e) : m_log(Category::getInstance(SHIBSP_LOGCAT".AttributeResolver")) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("QueryResolver"); +#endif + + DOMElement* child = XMLHelper::getFirstChildElement(e); + while (child) { + try { + if (XMLHelper::isNodeNamed(e, samlconstants::SAML20_NS, saml2::Attribute::LOCAL_NAME)) { + auto_ptr obj(saml2::AttributeBuilder::buildOneFromElement(child)); + saml2::Attribute* down = dynamic_cast(obj.get()); + if (down) { + m_SAML2Designators.push_back(down); + obj.release(); + } + } + else if (XMLHelper::isNodeNamed(e, samlconstants::SAML1P_NS, AttributeDesignator::LOCAL_NAME)) { + auto_ptr obj(AttributeDesignatorBuilder::buildOneFromElement(child)); + AttributeDesignator* down = dynamic_cast(obj.get()); + if (down) { + m_SAML1Designators.push_back(down); + obj.release(); + } + } + } + catch (exception& ex) { + m_log.error("exception loading attribute designator: %s", ex.what()); + } + child = XMLHelper::getNextSiblingElement(child); + } +} + +bool QueryResolver::SAML1Query(QueryContext& ctx) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("query"); +#endif + + int version = XMLString::equals(ctx.getProtocol(), samlconstants::SAML11_PROTOCOL_ENUM) ? 1 : 0; + const AttributeAuthorityDescriptor* AA = + find_if(ctx.getEntityDescriptor()->getAttributeAuthorityDescriptors(), isValidForProtocol(ctx.getProtocol())); + if (!AA) { + m_log.warn("no SAML 1.%d AttributeAuthority role found in metadata", version); + return false; + } + + const Application& application = ctx.getApplication(); + const PropertySet* relyingParty = application.getRelyingParty(ctx.getEntityDescriptor()); + shibsp::SecurityPolicy policy(application); + MetadataCredentialCriteria mcc(*AA); + shibsp::SOAPClient soaper(policy); + + auto_ptr_XMLCh binding(samlconstants::SAML1_BINDING_SOAP); + saml1p::Response* response=NULL; + const vector& endpoints=AA->getAttributeServices(); + for (vector::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) { + if (!XMLString::equals((*ep)->getBinding(),binding.get())) + continue; + auto_ptr_char loc((*ep)->getLocation()); + try { + NameIdentifier* nameid = NameIdentifierBuilder::buildNameIdentifier(); + nameid->setName(ctx.getNameID()->getName()); + nameid->setFormat(ctx.getNameID()->getFormat()); + nameid->setNameQualifier(ctx.getNameID()->getNameQualifier()); + saml1::Subject* subject = saml1::SubjectBuilder::buildSubject(); + subject->setNameIdentifier(nameid); + saml1p::AttributeQuery* query = saml1p::AttributeQueryBuilder::buildAttributeQuery(); + query->setSubject(subject); + query->setResource(relyingParty->getXMLString("entityID").second); + for (vector::const_iterator ad = m_SAML1Designators.begin(); ad!=m_SAML1Designators.end(); ++ad) + query->getAttributeDesignators().push_back((*ad)->cloneAttributeDesignator()); + Request* request = RequestBuilder::buildRequest(); + request->setAttributeQuery(query); + request->setMinorVersion(version); + + SAML1SOAPClient client(soaper, false); + client.sendSAML(request, application.getId(), mcc, loc.get()); + response = client.receiveSAML(); + } + catch (exception& ex) { + m_log.error("exception during SAML query to %s: %s", loc.get(), ex.what()); + soaper.reset(); + } + } + + if (!response) { + m_log.error("unable to obtain a SAML response from attribute authority"); + return false; + } + else if (!response->getStatus() || !response->getStatus()->getStatusCode() || response->getStatus()->getStatusCode()->getValue()==NULL || + *(response->getStatus()->getStatusCode()->getValue()) != saml1p::StatusCode::SUCCESS) { + delete response; + m_log.error("attribute authority returned a SAML error"); + return true; + } + + const vector& assertions = const_cast(response)->getAssertions(); + if (assertions.empty()) { + delete response; + m_log.warn("response from attribute authority was empty"); + return true; + } + else if (assertions.size()>1) + m_log.warn("simple resolver only supports one assertion in the query response"); + + auto_ptr wrapper(response); + saml1::Assertion* newtoken = assertions.front(); + + pair signedAssertions = relyingParty->getBool("requireSignedAssertions"); + if (!newtoken->getSignature() && signedAssertions.first && signedAssertions.second) { + m_log.error("assertion unsigned, rejecting it based on signedAssertions policy"); + return true; + } + + try { + // We're going to insist that the assertion issuer is the same as the peer. + // Reset the policy's message bits and extract them from the assertion. + policy.reset(true); + policy.setMessageID(newtoken->getAssertionID()); + policy.setIssueInstant(newtoken->getIssueInstantEpoch()); + policy.setIssuer(newtoken->getIssuer()); + policy.evaluate(*newtoken); + + // Now we can check the security status of the policy. + if (!policy.isAuthenticated()) + throw SecurityPolicyException("Security of SAML 1.x query result not established."); + + // Lastly, check it over. + saml1::AssertionValidator tokval(relyingParty->getXMLString("entityID").second, application.getAudiences(), time(NULL)); + tokval.validateAssertion(*newtoken); + } + catch (exception& ex) { + m_log.error("assertion failed policy/validation: %s", ex.what()); + return true; + } + + newtoken->detach(); + wrapper.release(); + ctx.getResolvedAssertions().push_back(newtoken); + + // Finally, extract and filter the result. + try { + AttributeExtractor* extractor = application.getAttributeExtractor(); + if (extractor) { + Locker extlocker(extractor); + extractor->extractAttributes(application, AA, *newtoken, ctx.getResolvedAttributes()); + } + + AttributeFilter* filter = application.getAttributeFilter(); + if (filter) { + BasicFilteringContext fc(application, ctx.getResolvedAttributes(), AA, ctx.getClassRef(), ctx.getDeclRef()); + Locker filtlocker(filter); + filter->filterAttributes(fc, ctx.getResolvedAttributes()); + } + } + catch (exception& ex) { + m_log.error("caught exception extracting/filtering attributes from query result: %s", ex.what()); + for_each(ctx.getResolvedAttributes().begin(), ctx.getResolvedAttributes().end(), xmltooling::cleanup()); + ctx.getResolvedAttributes().clear(); + } + + return true; +} + +bool QueryResolver::SAML2Query(QueryContext& ctx) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("query"); +#endif + + const AttributeAuthorityDescriptor* AA = + find_if(ctx.getEntityDescriptor()->getAttributeAuthorityDescriptors(), isValidForProtocol(samlconstants::SAML20P_NS)); + if (!AA) { + m_log.warn("no SAML 2 AttributeAuthority role found in metadata"); + return false; + } + + const Application& application = ctx.getApplication(); + shibsp::SecurityPolicy policy(application); + MetadataCredentialCriteria mcc(*AA); + shibsp::SOAPClient soaper(policy); + + const PropertySet* relyingParty = application.getRelyingParty(ctx.getEntityDescriptor()); + pair signedAssertions = relyingParty->getBool("requireSignedAssertions"); + pair encryption = relyingParty->getString("encryption"); + + auto_ptr_XMLCh binding(samlconstants::SAML20_BINDING_SOAP); + saml2p::StatusResponseType* srt=NULL; + const vector& endpoints=AA->getAttributeServices(); + for (vector::const_iterator ep=endpoints.begin(); !srt && ep!=endpoints.end(); ++ep) { + if (!XMLString::equals((*ep)->getBinding(),binding.get())) + continue; + auto_ptr_char loc((*ep)->getLocation()); + try { + auto_ptr subject(saml2::SubjectBuilder::buildSubject()); + + // Encrypt the NameID? + if (encryption.first && (!strcmp(encryption.second, "true") || !strcmp(encryption.second, "back"))) { + auto_ptr encrypted(EncryptedIDBuilder::buildEncryptedID()); + MetadataCredentialCriteria mcc(*AA); + encrypted->encrypt( + *ctx.getNameID(), + *(application.getMetadataProvider()), + mcc, + false, + relyingParty->getXMLString("encryptionAlg").second + ); + subject->setEncryptedID(encrypted.release()); + } + else { + subject->setNameID(ctx.getNameID()->cloneNameID()); + } + + saml2p::AttributeQuery* query = saml2p::AttributeQueryBuilder::buildAttributeQuery(); + query->setSubject(subject.release()); + Issuer* iss = IssuerBuilder::buildIssuer(); + iss->setName(relyingParty->getXMLString("entityID").second); + query->setIssuer(iss); + for (vector::const_iterator ad = m_SAML2Designators.begin(); ad!=m_SAML2Designators.end(); ++ad) + query->getAttributes().push_back((*ad)->cloneAttribute()); + + SAML2SOAPClient client(soaper, false); + client.sendSAML(query, application.getId(), mcc, loc.get()); + srt = client.receiveSAML(); + } + catch (exception& ex) { + m_log.error("exception during SAML query to %s: %s", loc.get(), ex.what()); + soaper.reset(); + } + } + + if (!srt) { + m_log.error("unable to obtain a SAML response from attribute authority"); + return false; + } + saml2p::Response* response = dynamic_cast(srt); + if (!response) { + delete srt; + m_log.error("message was not a samlp:Response"); + return true; + } + else if (!response->getStatus() || !response->getStatus()->getStatusCode() || + !XMLString::equals(response->getStatus()->getStatusCode()->getValue(), saml2p::StatusCode::SUCCESS)) { + delete srt; + m_log.error("attribute authority returned a SAML error"); + return true; + } + + const vector& assertions = const_cast(response)->getAssertions(); + if (assertions.empty()) { + delete srt; + m_log.warn("response from attribute authority was empty"); + return true; + } + else if (assertions.size()>1) + m_log.warn("simple resolver only supports one assertion in the query response"); + + auto_ptr wrapper(srt); + saml2::Assertion* newtoken = assertions.front(); + + if (!newtoken->getSignature() && signedAssertions.first && signedAssertions.second) { + m_log.error("assertion unsigned, rejecting it based on signedAssertions policy"); + return true; + } + + try { + // We're going to insist that the assertion issuer is the same as the peer. + // Reset the policy's message bits and extract them from the assertion. + policy.reset(true); + policy.setMessageID(newtoken->getID()); + policy.setIssueInstant(newtoken->getIssueInstantEpoch()); + policy.setIssuer(newtoken->getIssuer()); + policy.evaluate(*newtoken); + + // Now we can check the security status of the policy. + if (!policy.isAuthenticated()) + throw SecurityPolicyException("Security of SAML 2.0 query result not established."); + + // Lastly, check it over. + saml2::AssertionValidator tokval(relyingParty->getXMLString("entityID").second, application.getAudiences(), time(NULL)); + tokval.validateAssertion(*newtoken); + } + catch (exception& ex) { + m_log.error("assertion failed policy/validation: %s", ex.what()); + return true; + } + + newtoken->detach(); + wrapper.release(); + ctx.getResolvedAssertions().push_back(newtoken); + + // Finally, extract and filter the result. + try { + AttributeExtractor* extractor = application.getAttributeExtractor(); + if (extractor) { + Locker extlocker(extractor); + extractor->extractAttributes(application, AA, *newtoken, ctx.getResolvedAttributes()); + } + + AttributeFilter* filter = application.getAttributeFilter(); + if (filter) { + BasicFilteringContext fc(application, ctx.getResolvedAttributes(), AA, ctx.getClassRef(), ctx.getDeclRef()); + Locker filtlocker(filter); + filter->filterAttributes(fc, ctx.getResolvedAttributes()); + } + } + catch (exception& ex) { + m_log.error("caught exception extracting/filtering attributes from query result: %s", ex.what()); + for_each(ctx.getResolvedAttributes().begin(), ctx.getResolvedAttributes().end(), xmltooling::cleanup()); + ctx.getResolvedAttributes().clear(); + } + + return true; +} + +void QueryResolver::resolveAttributes(ResolutionContext& ctx) const +{ +#ifdef _DEBUG + xmltooling::NDC ndc("resolveAttributes"); +#endif + + QueryContext& qctx = dynamic_cast(ctx); + if (!qctx.doQuery()) { + m_log.debug("found AttributeStatement in input to new session, skipping query"); + return; + } + + if (qctx.getNameID() && qctx.getEntityDescriptor()) { + if (XMLString::equals(qctx.getProtocol(), samlconstants::SAML20P_NS)) { + m_log.debug("attempting SAML 2.0 attribute query"); + SAML2Query(qctx); + } + else if (XMLString::equals(qctx.getProtocol(), samlconstants::SAML11_PROTOCOL_ENUM) || + XMLString::equals(qctx.getProtocol(), samlconstants::SAML10_PROTOCOL_ENUM)) { + m_log.debug("attempting SAML 1.x attribute query"); + SAML1Query(qctx); + } + else + m_log.warn("SSO protocol does not allow for attribute query"); + } + else + m_log.warn("can't attempt attribute query, either no NameID or no metadata to use"); +} diff --git a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp new file mode 100644 index 0000000..f5f1cf2 --- /dev/null +++ b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp @@ -0,0 +1,544 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * XMLAttributeExtractor.cpp + * + * AttributeExtractor based on an XML mapping file. + */ + +#include "internal.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "attribute/AttributeDecoder.h" +#include "attribute/resolver/AttributeExtractor.h" +#include "util/SPConstants.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling; +using namespace std; +using saml1::NameIdentifier; +using saml2::NameID; +using saml2::EncryptedAttribute; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class XMLExtractorImpl + { + public: + XMLExtractorImpl(const DOMElement* e, Category& log); + ~XMLExtractorImpl() { + for (attrmap_t::iterator i = m_attrMap.begin(); i!=m_attrMap.end(); ++i) + delete i->second.first; + if (m_document) + m_document->release(); + } + + void setDocument(DOMDocument* doc) { + m_document = doc; + } + + void extractAttributes( + const Application& application, const char* assertingParty, const NameIdentifier& nameid, vector& attributes + ) const; + void extractAttributes( + const Application& application, const char* assertingParty, const NameID& nameid, vector& attributes + ) const; + void extractAttributes( + const Application& application, const char* assertingParty, const saml1::Attribute& attr, vector& attributes + ) const; + void extractAttributes( + const Application& application, const char* assertingParty, const saml2::Attribute& attr, vector& attributes + ) const; + void extractAttributes( + const Application& application, const char* assertingParty, const Extensions& ext, vector& attributes + ) const; + + void getAttributeIds(vector& attributes) const { + attributes.insert(attributes.end(), m_attributeIds.begin(), m_attributeIds.end()); + } + + private: + Category& m_log; + DOMDocument* m_document; +#ifdef HAVE_GOOD_STL + typedef map< pair,pair< AttributeDecoder*,vector > > attrmap_t; +#else + typedef map< pair,pair< AttributeDecoder*,vector > > attrmap_t; +#endif + attrmap_t m_attrMap; + vector m_attributeIds; + }; + + class XMLExtractor : public AttributeExtractor, public ReloadableXMLFile + { + public: + XMLExtractor(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor")), m_impl(NULL) { + load(); + } + ~XMLExtractor() { + delete m_impl; + } + + void extractAttributes( + const Application& application, const RoleDescriptor* issuer, const XMLObject& xmlObject, vector& attributes + ) const; + + void getAttributeIds(std::vector& attributes) const { + if (m_impl) + m_impl->getAttributeIds(attributes); + } + + protected: + pair load(); + + private: + XMLExtractorImpl* m_impl; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + AttributeExtractor* SHIBSP_DLLLOCAL XMLAttributeExtractorFactory(const DOMElement* const & e) + { + return new XMLExtractor(e); + } + + static const XMLCh _AttributeDecoder[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r); + static const XMLCh Attributes[] = UNICODE_LITERAL_10(A,t,t,r,i,b,u,t,e,s); + static const XMLCh _id[] = UNICODE_LITERAL_2(i,d); + static const XMLCh _aliases[] = UNICODE_LITERAL_7(a,l,i,a,s,e,s); + static const XMLCh _name[] = UNICODE_LITERAL_4(n,a,m,e); + static const XMLCh nameFormat[] = UNICODE_LITERAL_10(n,a,m,e,F,o,r,m,a,t); +}; + +XMLExtractorImpl::XMLExtractorImpl(const DOMElement* e, Category& log) : m_log(log), m_document(NULL) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("XMLExtractorImpl"); +#endif + + if (!XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEMAP_NS, Attributes)) + throw ConfigurationException("XML AttributeExtractor requires am:Attributes at root of configuration."); + + DOMElement* child = XMLHelper::getFirstChildElement(e, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME); + while (child) { + // Check for missing name or id. + const XMLCh* name = child->getAttributeNS(NULL, _name); + if (!name || !*name) { + m_log.warn("skipping Attribute with no name"); + child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME); + continue; + } + + auto_ptr_char id(child->getAttributeNS(NULL, _id)); + if (!id.get() || !*id.get()) { + m_log.warn("skipping Attribute with no id"); + child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME); + continue; + } + else if (!strcmp(id.get(), "REMOTE_USER")) { + m_log.warn("skipping Attribute, id of REMOTE_USER is a reserved name"); + child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME); + continue; + } + + AttributeDecoder* decoder=NULL; + try { + DOMElement* dchild = XMLHelper::getFirstChildElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, _AttributeDecoder); + if (dchild) { + auto_ptr q(XMLHelper::getXSIType(dchild)); + if (q.get()) + decoder = SPConfig::getConfig().AttributeDecoderManager.newPlugin(*q.get(), dchild); + } + if (!decoder) + decoder = SPConfig::getConfig().AttributeDecoderManager.newPlugin(StringAttributeDecoderType, NULL); + } + catch (exception& ex) { + m_log.error("skipping Attribute (%s), error building AttributeDecoder: %s", id.get(), ex.what()); + } + + if (!decoder) { + child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME); + continue; + } + + // Empty NameFormat implies the usual Shib URI naming defaults. + const XMLCh* format = child->getAttributeNS(NULL, nameFormat); + if (!format || XMLString::equals(format, shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI) || + XMLString::equals(format, saml2::Attribute::URI_REFERENCE)) + format = &chNull; // ignore default Format/Namespace values + + // Fetch/create the map entry and see if it's a duplicate rule. +#ifdef HAVE_GOOD_STL + pair< AttributeDecoder*,vector >& decl = m_attrMap[pair(name,format)]; +#else + auto_ptr_char n(name); + auto_ptr_char f(format); + pair< AttributeDecoder*,vector >& decl = m_attrMap[pair(n.get(),f.get())]; +#endif + if (decl.first) { + m_log.warn("skipping duplicate Attribute mapping (same name and nameFormat)"); + delete decoder; + child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME); + continue; + } + + if (m_log.isInfoEnabled()) { +#ifdef HAVE_GOOD_STL + auto_ptr_char n(name); + auto_ptr_char f(format); +#endif + m_log.info("creating mapping for Attribute %s%s%s", n.get(), *f.get() ? ", Format/Namespace:" : "", f.get()); + } + + decl.first = decoder; + decl.second.push_back(id.get()); + m_attributeIds.push_back(id.get()); + + name = child->getAttributeNS(NULL, _aliases); + if (name && *name) { + auto_ptr_char aliases(name); + char* pos; + char* start = const_cast(aliases.get()); + while (start && *start) { + while (*start && isspace(*start)) + start++; + if (!*start) + break; + pos = strchr(start,' '); + if (pos) + *pos=0; + if (strcmp(start, "REMOTE_USER")) { + decl.second.push_back(start); + m_attributeIds.push_back(start); + } + else { + m_log.warn("skipping alias, REMOTE_USER is a reserved name"); + } + start = pos ? pos+1 : NULL; + } + } + + child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME); + } +} + +void XMLExtractorImpl::extractAttributes( + const Application& application, const char* assertingParty, const NameIdentifier& nameid, vector& attributes + ) const +{ +#ifdef HAVE_GOOD_STL + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#else + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#endif + + const XMLCh* format = nameid.getFormat(); + if (!format || !*format) + format = NameIdentifier::UNSPECIFIED; +#ifdef HAVE_GOOD_STL + if ((rule=m_attrMap.find(pair(format,xstring()))) != m_attrMap.end()) { +#else + auto_ptr_char temp(format); + if ((rule=m_attrMap.find(pair(temp.get(),string()))) != m_attrMap.end()) { +#endif + Attribute* a = rule->second.first->decode(rule->second.second, &nameid, assertingParty, application.getString("entityID").second); + if (a) + attributes.push_back(a); + } + else if (m_log.isDebugEnabled()) { +#ifdef HAVE_GOOD_STL + auto_ptr_char temp(format); +#endif + m_log.debug("skipping unmapped NameIdentifier with format (%s)", temp.get()); + } +} + +void XMLExtractorImpl::extractAttributes( + const Application& application, const char* assertingParty, const NameID& nameid, vector& attributes + ) const +{ +#ifdef HAVE_GOOD_STL + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#else + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#endif + + const XMLCh* format = nameid.getFormat(); + if (!format || !*format) + format = NameID::UNSPECIFIED; +#ifdef HAVE_GOOD_STL + if ((rule=m_attrMap.find(pair(format,xstring()))) != m_attrMap.end()) { +#else + auto_ptr_char temp(format); + if ((rule=m_attrMap.find(pair(temp.get(),string()))) != m_attrMap.end()) { +#endif + Attribute* a = rule->second.first->decode(rule->second.second, &nameid, assertingParty, application.getString("entityID").second); + if (a) + attributes.push_back(a); + } + else if (m_log.isDebugEnabled()) { +#ifdef HAVE_GOOD_STL + auto_ptr_char temp(format); +#endif + m_log.debug("skipping unmapped NameID with format (%s)", temp.get()); + } +} + +void XMLExtractorImpl::extractAttributes( + const Application& application, const char* assertingParty, const saml1::Attribute& attr, vector& attributes + ) const +{ +#ifdef HAVE_GOOD_STL + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#else + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#endif + + const XMLCh* name = attr.getAttributeName(); + const XMLCh* format = attr.getAttributeNamespace(); + if (!name || !*name) + return; + if (!format || XMLString::equals(format, shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI)) + format = &chNull; +#ifdef HAVE_GOOD_STL + if ((rule=m_attrMap.find(pair(name,format))) != m_attrMap.end()) { +#else + auto_ptr_char temp1(name); + auto_ptr_char temp2(format); + if ((rule=m_attrMap.find(pair(temp1.get(),temp2.get()))) != m_attrMap.end()) { +#endif + Attribute* a = rule->second.first->decode(rule->second.second, &attr, assertingParty, application.getString("entityID").second); + if (a) + attributes.push_back(a); + } + else if (m_log.isInfoEnabled()) { +#ifdef HAVE_GOOD_STL + auto_ptr_char temp1(name); + auto_ptr_char temp2(format); +#endif + m_log.info("skipping unmapped SAML 1.x Attribute with Name: %s%s%s", temp1.get(), *temp2.get() ? ", Namespace:" : "", temp2.get()); + } +} + +void XMLExtractorImpl::extractAttributes( + const Application& application, const char* assertingParty, const saml2::Attribute& attr, vector& attributes + ) const +{ +#ifdef HAVE_GOOD_STL + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#else + map< pair,pair< AttributeDecoder*,vector > >::const_iterator rule; +#endif + + const XMLCh* name = attr.getName(); + const XMLCh* format = attr.getNameFormat(); + if (!name || !*name) + return; + if (!format || !*format) + format = saml2::Attribute::UNSPECIFIED; + else if (XMLString::equals(format, saml2::Attribute::URI_REFERENCE)) + format = &chNull; +#ifdef HAVE_GOOD_STL + if ((rule=m_attrMap.find(pair(name,format))) != m_attrMap.end()) { +#else + auto_ptr_char temp1(name); + auto_ptr_char temp2(format); + if ((rule=m_attrMap.find(pair(temp1.get(),temp2.get()))) != m_attrMap.end()) { +#endif + Attribute* a = rule->second.first->decode(rule->second.second, &attr, assertingParty, application.getString("entityID").second); + if (a) + attributes.push_back(a); + } + else if (m_log.isInfoEnabled()) { +#ifdef HAVE_GOOD_STL + auto_ptr_char temp1(name); + auto_ptr_char temp2(format); +#endif + m_log.info("skipping unmapped SAML 2.0 Attribute with Name: %s%s%s", temp1.get(), *temp2.get() ? ", Format:" : "", temp2.get()); + } +} + +void XMLExtractorImpl::extractAttributes( + const Application& application, const char* assertingParty, const Extensions& ext, vector& attributes + ) const +{ + const vector exts = ext.getUnknownXMLObjects(); + for (vector::const_iterator i = exts.begin(); i!=exts.end(); ++i) { + const saml2::Attribute* attr = dynamic_cast(*i); + if (attr) + extractAttributes(application, assertingParty, *attr, attributes); + } +} + +void XMLExtractor::extractAttributes( + const Application& application, const RoleDescriptor* issuer, const XMLObject& xmlObject, vector& attributes + ) const +{ + if (!m_impl) + return; + + // Check for assertions. + if (XMLString::equals(xmlObject.getElementQName().getLocalPart(), saml1::Assertion::LOCAL_NAME)) { + const saml2::Assertion* token2 = dynamic_cast(&xmlObject); + if (token2) { + auto_ptr_char assertingParty(issuer ? dynamic_cast(issuer->getParent())->getEntityID() : NULL); + const vector& statements = token2->getAttributeStatements(); + for (vector::const_iterator s = statements.begin(); s!=statements.end(); ++s) { + const vector& attrs = const_cast(*s)->getAttributes(); + for (vector::const_iterator a = attrs.begin(); a!=attrs.end(); ++a) + m_impl->extractAttributes(application, assertingParty.get(), *(*a), attributes); + + const vector& encattrs = const_cast(*s)->getEncryptedAttributes(); + for (vector::const_iterator ea = encattrs.begin(); ea!=encattrs.end(); ++ea) + extractAttributes(application, issuer, *(*ea), attributes); + } + return; + } + + const saml1::Assertion* token1 = dynamic_cast(&xmlObject); + if (token1) { + auto_ptr_char assertingParty(issuer ? dynamic_cast(issuer->getParent())->getEntityID() : NULL); + const vector& statements = token1->getAttributeStatements(); + for (vector::const_iterator s = statements.begin(); s!=statements.end(); ++s) { + const vector& attrs = const_cast(*s)->getAttributes(); + for (vector::const_iterator a = attrs.begin(); a!=attrs.end(); ++a) + m_impl->extractAttributes(application, assertingParty.get(), *(*a), attributes); + } + return; + } + + throw AttributeExtractionException("Unable to extract attributes, unknown object type."); + } + + // Check for metadata. + if (XMLString::equals(xmlObject.getElementQName().getNamespaceURI(), samlconstants::SAML20MD_NS)) { + const EntityDescriptor* entity = dynamic_cast(&xmlObject); + if (!entity) + throw AttributeExtractionException("Unable to extract attributes, unknown metadata object type."); + auto_ptr_char assertingParty(issuer ? dynamic_cast(issuer->getParent())->getEntityID() : NULL); + const Extensions* ext = entity->getExtensions(); + if (ext) + m_impl->extractAttributes(application, assertingParty.get(), *ext, attributes); + const EntitiesDescriptor* group = dynamic_cast(entity->getParent()); + while (group) { + ext = group->getExtensions(); + if (ext) + m_impl->extractAttributes(application, assertingParty.get(), *ext, attributes); + group = dynamic_cast(group->getParent()); + } + return; + } + + // Check for attributes. + if (XMLString::equals(xmlObject.getElementQName().getLocalPart(), saml1::Attribute::LOCAL_NAME)) { + auto_ptr_char assertingParty(issuer ? dynamic_cast(issuer->getParent())->getEntityID() : NULL); + + const saml2::Attribute* attr2 = dynamic_cast(&xmlObject); + if (attr2) + return m_impl->extractAttributes(application, assertingParty.get(), *attr2, attributes); + + const saml1::Attribute* attr1 = dynamic_cast(&xmlObject); + if (attr1) + return m_impl->extractAttributes(application, assertingParty.get(), *attr1, attributes); + + throw AttributeExtractionException("Unable to extract attributes, unknown object type."); + } + + if (XMLString::equals(xmlObject.getElementQName().getLocalPart(), EncryptedAttribute::LOCAL_NAME)) { + const EncryptedAttribute* encattr = dynamic_cast(&xmlObject); + if (encattr) { + const XMLCh* recipient = application.getXMLString("entityID").second; + CredentialResolver* cr = application.getCredentialResolver(); + if (!cr) { + m_log.warn("found encrypted attribute, but no CredentialResolver was available"); + return; + } + + try { + Locker credlocker(cr); + if (issuer) { + MetadataCredentialCriteria mcc(*issuer); + auto_ptr decrypted(encattr->decrypt(*cr, recipient, &mcc)); + if (m_log.isDebugEnabled()) + m_log.debugStream() << "decrypted Attribute: " << *(decrypted.get()) << logging::eol; + return extractAttributes(application, issuer, *(decrypted.get()), attributes); + } + else { + auto_ptr decrypted(encattr->decrypt(*cr, recipient)); + if (m_log.isDebugEnabled()) + m_log.debugStream() << "decrypted Attribute: " << *(decrypted.get()) << logging::eol; + return extractAttributes(application, issuer, *(decrypted.get()), attributes); + } + } + catch (exception& ex) { + m_log.error("caught exception decrypting Attribute: %s", ex.what()); + return; + } + } + } + + // Check for NameIDs. + const NameID* name2 = dynamic_cast(&xmlObject); + if (name2) { + auto_ptr_char assertingParty(issuer ? dynamic_cast(issuer->getParent())->getEntityID() : NULL); + return m_impl->extractAttributes(application, assertingParty.get(), *name2, attributes); + } + + const NameIdentifier* name1 = dynamic_cast(&xmlObject); + if (name1) { + auto_ptr_char assertingParty(issuer ? dynamic_cast(issuer->getParent())->getEntityID() : NULL); + return m_impl->extractAttributes(application, assertingParty.get(), *name1, attributes); + } + + throw AttributeExtractionException("Unable to extract attributes, unknown object type."); +} + +pair XMLExtractor::load() +{ + // Load from source using base class. + pair raw = ReloadableXMLFile::load(); + + // If we own it, wrap it. + XercesJanitor docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL); + + XMLExtractorImpl* impl = new XMLExtractorImpl(raw.second, m_log); + + // If we held the document, transfer it to the impl. If we didn't, it's a no-op. + impl->setDocument(docjanitor.release()); + + delete m_impl; + m_impl = impl; + + return make_pair(false,(DOMElement*)NULL); +} diff --git a/shibsp/base.h b/shibsp/base.h new file mode 100644 index 0000000..9eb4cf3 --- /dev/null +++ b/shibsp/base.h @@ -0,0 +1,106 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/base.h + * + * Base header file definitions + * Must be included prior to including any other header + */ + +#ifndef __shibsp_base_h__ +#define __shibsp_base_h__ + +#ifdef SHIBSP_LITE +# define XMLTOOLING_LITE +# include +#else +# include +#endif + +// Windows and GCC4 Symbol Visibility Macros +#ifdef WIN32 + #define SHIBSP_IMPORT __declspec(dllimport) + #define SHIBSP_EXPORT __declspec(dllexport) + #define SHIBSP_DLLLOCAL + #define SHIBSP_DLLPUBLIC +#else + #define SHIBSP_IMPORT + #ifdef GCC_HASCLASSVISIBILITY + #define SHIBSP_EXPORT __attribute__ ((visibility("default"))) + #define SHIBSP_DLLLOCAL __attribute__ ((visibility("hidden"))) + #define SHIBSP_DLLPUBLIC __attribute__ ((visibility("default"))) + #else + #define SHIBSP_EXPORT + #define SHIBSP_DLLLOCAL + #define SHIBSP_DLLPUBLIC + #endif +#endif + +// Define SHIBSP_API for DLL builds +#ifdef SHIBSP_EXPORTS + #define SHIBSP_API SHIBSP_EXPORT +#else + #define SHIBSP_API SHIBSP_IMPORT +#endif + +// Throwable classes must always be visible on GCC in all binaries +#ifdef WIN32 + #define SHIBSP_EXCEPTIONAPI(api) api +#elif defined(GCC_HASCLASSVISIBILITY) + #define SHIBSP_EXCEPTIONAPI(api) SHIBSP_EXPORT +#else + #define SHIBSP_EXCEPTIONAPI(api) +#endif + +#ifdef WIN32 + +/** + * 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" + +/** + * Default name of configuration file on Windows. + */ +# define SHIBSP_CONFIG "shibboleth2.xml" + +/** + * Controls default logging level of console tools and other situations + * where fully-configured logging isn't used. + */ +#define SHIBSP_LOGGING "console.logger" + +/** + * Default prefix for installation (used to resolve relative paths). + */ +#define SHIBSP_PREFIX "c:/opt/shibboleth-sp" + +#else +# include +#endif + +/** + * Logging category for Service Provider functions. + */ +#define SHIBSP_LOGCAT "Shibboleth" + +/** + * Logging category for Service Provider auditing. + */ +#define SHIBSP_TX_LOGCAT "Shibboleth-TRANSACTION" + +#endif /* __shibsp_base_h__ */ diff --git a/shibsp/binding/ArtifactResolver.h b/shibsp/binding/ArtifactResolver.h new file mode 100644 index 0000000..7f89680 --- /dev/null +++ b/shibsp/binding/ArtifactResolver.h @@ -0,0 +1,53 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/binding/ArtifactResolver.h + * + * SAML artifact resolver for SP use. + */ + +#ifndef __shibsp_artres_h__ +#define __shibsp_artres_h__ + +#include +#include + +namespace shibsp { + + /** + * SAML artifact resolver for SP use. + */ + class SHIBSP_API ArtifactResolver : public opensaml::MessageDecoder::ArtifactResolver { + public: + ArtifactResolver() {} + virtual ~ArtifactResolver() {} + + opensaml::saml1p::Response* resolve( + const std::vector& artifacts, + const opensaml::saml2md::IDPSSODescriptor& idpDescriptor, + opensaml::SecurityPolicy& policy + ) const; + + opensaml::saml2p::ArtifactResponse* resolve( + const opensaml::saml2p::SAML2Artifact& artifact, + const opensaml::saml2md::SSODescriptorType& ssoDescriptor, + opensaml::SecurityPolicy& policy + ) const; + }; +}; + +#endif /* __shibsp_artres_h__ */ diff --git a/shibsp/binding/SOAPClient.h b/shibsp/binding/SOAPClient.h new file mode 100644 index 0000000..573f3f1 --- /dev/null +++ b/shibsp/binding/SOAPClient.h @@ -0,0 +1,87 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/binding/SOAPClient.h + * + * Specialized SOAPClient for SP environment. + */ + +#ifndef __shibsp_soap11client_h__ +#define __shibsp_soap11client_h__ + +#include +#include +#include + +namespace shibsp { + + class SHIBSP_API PropertySet; + + /** + * Specialized SOAPClient for SP environment. + */ + class SHIBSP_API SOAPClient : public opensaml::SOAPClient + { + public: + /** + * Creates a SOAP client instance for an Application to use. + * + * @param policy reference to SP-SecurityPolicy to apply + */ + SOAPClient(SecurityPolicy& policy); + + virtual ~SOAPClient() { + if (m_credResolver) + m_credResolver->unlock(); + } + + /** + * Override handles message signing for SAML payloads. + * + * @param env SOAP envelope to send + * @param from identity of sending application + * @param to peer to send message to, expressed in metadata terms + * @param endpoint URL of endpoint to recieve message + */ + void send(const soap11::Envelope& env, const char* from, opensaml::saml2md::MetadataCredentialCriteria& to, const char* endpoint); + + void reset(); + + protected: + /** + * Override prepares transport by applying policy settings from Application. + * + * @param transport reference to transport layer + */ + void prepareTransport(xmltooling::SOAPTransport& transport); + + /** Application supplied to client. */ + const Application& m_app; + + /** Properties associated with the Application's security policy. */ + const PropertySet* m_settings; + + /** RelyingParty properties, set after transport prep. */ + const PropertySet* m_relyingParty; + + /** Locked CredentialResolver for transport, set after transport prep. */ + xmltooling::CredentialResolver* m_credResolver; + }; + +}; + +#endif /* __shibsp_soap11client_h__ */ diff --git a/shibsp/binding/impl/ArtifactResolver.cpp b/shibsp/binding/impl/ArtifactResolver.cpp new file mode 100644 index 0000000..332549f --- /dev/null +++ b/shibsp/binding/impl/ArtifactResolver.cpp @@ -0,0 +1,158 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ArtifactResolver.cpp + * + * SAML artifact resolver for SP use. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "binding/ArtifactResolver.h" +#include "binding/SOAPClient.h" +#include "security/SecurityPolicy.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml1p; +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +saml1p::Response* ArtifactResolver::resolve( + const vector& artifacts, + const IDPSSODescriptor& idpDescriptor, + opensaml::SecurityPolicy& policy + ) const +{ + MetadataCredentialCriteria mcc(idpDescriptor); + shibsp::SecurityPolicy& sppolicy = dynamic_cast(policy); + shibsp::SOAPClient soaper(sppolicy); + + bool foundEndpoint = false; + auto_ptr_XMLCh binding(samlconstants::SAML1_BINDING_SOAP); + saml1p::Response* response=NULL; + const vector& endpoints=idpDescriptor.getArtifactResolutionServices(); + for (vector::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) { + try { + if (!XMLString::equals((*ep)->getBinding(),binding.get())) + continue; + foundEndpoint = true; + auto_ptr_char loc((*ep)->getLocation()); + saml1p::Request* request = saml1p::RequestBuilder::buildRequest(); + request->setMinorVersion(idpDescriptor.hasSupport(samlconstants::SAML11_PROTOCOL_ENUM) ? 1 : 0); + for (vector::const_iterator a = artifacts.begin(); a!=artifacts.end(); ++a) { + auto_ptr_XMLCh artbuf((*a)->encode().c_str()); + AssertionArtifact* aa = AssertionArtifactBuilder::buildAssertionArtifact(); + aa->setArtifact(artbuf.get()); + request->getAssertionArtifacts().push_back(aa); + } + + SAML1SOAPClient client(soaper, false); + client.sendSAML(request, sppolicy.getApplication().getId(), mcc, loc.get()); + response = client.receiveSAML(); + } + catch (exception& ex) { + Category::getInstance(SHIBSP_LOGCAT".ArtifactResolver").error("exception resolving SAML 1.x artifact(s): %s", ex.what()); + soaper.reset(); + } + } + + if (!foundEndpoint) + throw MetadataException("No compatible endpoint found in issuer's metadata."); + else if (!response) + throw BindingException("Unable to resolve artifact(s) into a SAML response."); + const QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : NULL; + if (!code || *code != saml1p::StatusCode::SUCCESS) { + delete response; + throw BindingException("Identity provider returned a SAML error in response to artifact(s)."); + } + + // The SOAP client handles policy evaluation against the SOAP and Response layer, + // but no security checking is done here. + return response; +} + +ArtifactResponse* ArtifactResolver::resolve( + const SAML2Artifact& artifact, + const SSODescriptorType& ssoDescriptor, + opensaml::SecurityPolicy& policy + ) const +{ + MetadataCredentialCriteria mcc(ssoDescriptor); + shibsp::SecurityPolicy& sppolicy = dynamic_cast(policy); + shibsp::SOAPClient soaper(sppolicy); + + bool foundEndpoint = false; + auto_ptr_XMLCh binding(samlconstants::SAML20_BINDING_SOAP); + ArtifactResponse* response=NULL; + const vector& endpoints=ssoDescriptor.getArtifactResolutionServices(); + for (vector::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) { + try { + if (!XMLString::equals((*ep)->getBinding(),binding.get())) + continue; + foundEndpoint = true; + auto_ptr_char loc((*ep)->getLocation()); + ArtifactResolve* request = ArtifactResolveBuilder::buildArtifactResolve(); + Issuer* iss = IssuerBuilder::buildIssuer(); + request->setIssuer(iss); + iss->setName(sppolicy.getApplication().getRelyingParty(dynamic_cast(ssoDescriptor.getParent()))->getXMLString("entityID").second); + auto_ptr_XMLCh artbuf(artifact.encode().c_str()); + Artifact* a = ArtifactBuilder::buildArtifact(); + a->setArtifact(artbuf.get()); + request->setArtifact(a); + + SAML2SOAPClient client(soaper, false); + client.sendSAML(request, sppolicy.getApplication().getId(), mcc, loc.get()); + StatusResponseType* srt = client.receiveSAML(); + if (!(response = dynamic_cast(srt))) { + delete srt; + break; + } + } + catch (exception& ex) { + Category::getInstance(SHIBSP_LOGCAT".ArtifactResolver").error("exception resolving SAML 2.0 artifact: %s", ex.what()); + soaper.reset(); + } + } + + if (!foundEndpoint) + throw MetadataException("No compatible endpoint found in issuer's metadata."); + else if (!response) + throw BindingException("Unable to resolve artifact(s) into a SAML response."); + else if (!response->getStatus() || !response->getStatus()->getStatusCode() || + !XMLString::equals(response->getStatus()->getStatusCode()->getValue(), saml2p::StatusCode::SUCCESS)) { + auto_ptr wrapper(response); + BindingException ex("Identity provider returned a SAML error in response to artifact."); + annotateException(&ex, &ssoDescriptor, response->getStatus()); // rethrow + } + + // The SOAP client handles policy evaluation against the SOAP and Response layer, + // but no security checking is done here. + return response; +} diff --git a/shibsp/binding/impl/SOAPClient.cpp b/shibsp/binding/impl/SOAPClient.cpp new file mode 100644 index 0000000..656a2c8 --- /dev/null +++ b/shibsp/binding/impl/SOAPClient.cpp @@ -0,0 +1,195 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SOAPClient.cpp + * + * Specialized SOAPClient for SP environment. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "binding/SOAPClient.h" + +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace xmlsignature; +using namespace xmltooling; +using namespace std; + +SOAPClient::SOAPClient(SecurityPolicy& policy) + : opensaml::SOAPClient(policy), m_app(policy.getApplication()), m_settings(NULL), m_relyingParty(NULL), m_credResolver(NULL) +{ + m_settings = m_app.getServiceProvider().getPolicySettings(m_app.getString("policyId").second); + pair validate = m_settings->getBool("validate"); + policy.setValidating(validate.first && validate.second); + setValidating(validate.first && validate.second); +} + +void SOAPClient::send(const soap11::Envelope& env, const char* from, MetadataCredentialCriteria& to, const char* endpoint) +{ + // Check for message signing requirements. + m_relyingParty = m_app.getRelyingParty(dynamic_cast(to.getRole().getParent())); + pair flag = m_relyingParty->getString("signing"); + if (flag.first && (!strcmp(flag.second, "true") || !strcmp(flag.second, "back"))) { + m_credResolver=m_app.getCredentialResolver(); + if (m_credResolver) { + m_credResolver->lock(); + // Fill in criteria to use. + to.setUsage(Credential::SIGNING_CREDENTIAL); + pair keyName = m_relyingParty->getString("keyName"); + if (keyName.first) + to.getKeyNames().insert(keyName.second); + pair sigalg = m_relyingParty->getXMLString("signingAlg"); + if (sigalg.first) + to.setXMLAlgorithm(sigalg.second); + const Credential* cred = m_credResolver->resolve(&to); + // Reset criteria back. + to.setKeyAlgorithm(NULL); + to.setKeySize(0); + + if (cred) { + // Check for message. + const vector& bodies=const_cast(env.getBody())->getUnknownXMLObjects(); + if (!bodies.empty()) { + opensaml::SignableObject* msg = dynamic_cast(bodies.front()); + if (msg) { + // Build a Signature. + Signature* sig = SignatureBuilder::buildSignature(); + msg->setSignature(sig); + if (sigalg.first) + sig->setSignatureAlgorithm(sigalg.second); + sigalg = m_relyingParty->getXMLString("digestAlg"); + if (sigalg.first) + dynamic_cast(sig->getContentReference())->setDigestAlgorithm(sigalg.second); + + // Sign it. The marshalling step in the base class should be a no-op. + vector sigs(1,sig); + env.marshall((DOMDocument*)NULL,&sigs,cred); + } + } + } + else { + Category::getInstance(SHIBSP_LOGCAT".SOAPClient").error("no signing credential supplied, leaving unsigned."); + } + } + else { + Category::getInstance(SHIBSP_LOGCAT".SOAPClient").error("no CredentialResolver available, leaving unsigned."); + } + } + + opensaml::SOAPClient::send(env, from, to, endpoint); +} + +void SOAPClient::prepareTransport(SOAPTransport& transport) +{ +#ifdef _DEBUG + xmltooling::NDC("prepareTransport"); +#endif + Category& log=Category::getInstance(SHIBSP_LOGCAT".SOAPClient"); + log.debug("prepping SOAP transport for use by application (%s)", m_app.getId()); + + pair flag = m_relyingParty->getBool("requireConfidentiality"); + if ((!flag.first || flag.second) && !transport.isConfidential()) + throw opensaml::BindingException("Transport confidentiality required, but not available."); + + flag = m_settings->getBool("validate"); + setValidating(flag.first && flag.second); + flag = m_relyingParty->getBool("requireTransportAuth"); + forceTransportAuthentication(!flag.first || flag.second); + + opensaml::SOAPClient::prepareTransport(transport); + + pair authType=m_relyingParty->getString("authType"); + if (!authType.first || !strcmp(authType.second,"TLS")) { + if (!m_credResolver) { + m_credResolver = m_app.getCredentialResolver(); + if (m_credResolver) + m_credResolver->lock(); + } + if (m_credResolver) { + m_criteria->setUsage(Credential::TLS_CREDENTIAL); + authType = m_relyingParty->getString("keyName"); + if (authType.first) + m_criteria->getKeyNames().insert(authType.second); + const Credential* cred = m_credResolver->resolve(m_criteria); + if (cred) { + if (!transport.setCredential(cred)) + log.error("failed to load Credential into SOAPTransport"); + } + else { + log.error("no TLS credential supplied"); + } + } + else { + log.error("no CredentialResolver available for TLS"); + } + } + else { + SOAPTransport::transport_auth_t type=SOAPTransport::transport_auth_none; + pair username=m_relyingParty->getString("authUsername"); + pair password=m_relyingParty->getString("authPassword"); + if (!username.first || !password.first) + log.error("transport authType (%s) specified but authUsername or authPassword was missing", authType.second); + else if (!strcmp(authType.second,"basic")) + type = SOAPTransport::transport_auth_basic; + else if (!strcmp(authType.second,"digest")) + type = SOAPTransport::transport_auth_digest; + else if (!strcmp(authType.second,"ntlm")) + type = SOAPTransport::transport_auth_ntlm; + else if (!strcmp(authType.second,"gss")) + type = SOAPTransport::transport_auth_gss; + else if (strcmp(authType.second,"none")) + log.error("unknown authType (%s) specified for RelyingParty", authType.second); + if (type > SOAPTransport::transport_auth_none) { + if (transport.setAuth(type,username.second,password.second)) + log.debug("configured for transport authentication (method=%s, username=%s)", authType.second, username.second); + else + log.error("failed to configure transport authentication (method=%s)", authType.second); + } + } + + pair timeout = m_relyingParty->getUnsignedInt("connectTimeout"); + transport.setConnectTimeout(timeout.first ? timeout.second : 10); + timeout = m_relyingParty->getUnsignedInt("timeout"); + transport.setTimeout(timeout.first ? timeout.second : 20); + m_app.getServiceProvider().setTransportOptions(transport); + + HTTPSOAPTransport* http = dynamic_cast(&transport); + if (http) { + flag = m_relyingParty->getBool("chunkedEncoding"); + http->useChunkedEncoding(flag.first && flag.second); + http->setRequestHeader("User-Agent", PACKAGE_NAME); + http->setRequestHeader(PACKAGE_NAME, PACKAGE_VERSION); + } +} + +void SOAPClient::reset() +{ + m_relyingParty = NULL; + if (m_credResolver) + m_credResolver->unlock(); + m_credResolver = NULL; + opensaml::SOAPClient::reset(); +} + diff --git a/shibsp/exceptions.h b/shibsp/exceptions.h new file mode 100644 index 0000000..a12e720 --- /dev/null +++ b/shibsp/exceptions.h @@ -0,0 +1,58 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/exceptions.h + * + * Exception classes + */ + +#ifndef __shibsp_exceptions_h__ +#define __shibsp_exceptions_h__ + +#include +#ifndef SHIBSP_LITE +# include +#else +# include +#endif + +namespace shibsp { + + DECL_XMLTOOLING_EXCEPTION(AttributeException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,xmltooling::XMLToolingException,Exceptions during attribute processing.); + DECL_XMLTOOLING_EXCEPTION(AttributeExtractionException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,shibsp::AttributeException,Exceptions during attribute extraction.); + DECL_XMLTOOLING_EXCEPTION(AttributeFilteringException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,shibsp::AttributeException,Exceptions during attribute filtering.); + DECL_XMLTOOLING_EXCEPTION(AttributeResolutionException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,shibsp::AttributeException,Exceptions during attribute resolution.); + DECL_XMLTOOLING_EXCEPTION(ConfigurationException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,xmltooling::XMLToolingException,Exceptions during configuration.); + DECL_XMLTOOLING_EXCEPTION(ListenerException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,xmltooling::XMLToolingException,Exceptions during inter-process communication.); + +}; + +#ifdef SHIBSP_LITE +namespace opensaml { + DECL_XMLTOOLING_EXCEPTION(BindingException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,xmltooling::XMLToolingException,Exceptions in SAML binding processing); + DECL_XMLTOOLING_EXCEPTION(SecurityPolicyException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,xmltooling::XMLToolingException,Exceptions in security policy processing); + DECL_XMLTOOLING_EXCEPTION(ProfileException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,xmltooling::ValidationException,Exceptions in SAML profile processing); + DECL_XMLTOOLING_EXCEPTION(FatalProfileException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,ProfileException,Fatal exceptions in SAML profile processing); + DECL_XMLTOOLING_EXCEPTION(RetryableProfileException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,ProfileException,Non-fatal exceptions in SAML profile processing); + + namespace saml2md { + DECL_XMLTOOLING_EXCEPTION(MetadataException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml::saml2md,xmltooling::XMLToolingException,Exceptions related to metadata use); + }; +}; +#endif + +#endif /* __shibsp_exceptions_h__ */ diff --git a/shibsp/handler/AbstractHandler.h b/shibsp/handler/AbstractHandler.h new file mode 100644 index 0000000..140fa11 --- /dev/null +++ b/shibsp/handler/AbstractHandler.h @@ -0,0 +1,174 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/handler/AbstractHandler.h + * + * Base class for handlers based on a DOMPropertySet. + */ + +#ifndef __shibsp_abshandler_h__ +#define __shibsp_abshandler_h__ + +#include +#include + +#ifndef SHIBSP_LITE +# include +# include +#endif +#include +#include +#include +#include + +namespace shibsp { + + class SHIBSP_API Application; + class SHIBSP_API SPRequest; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + /** + * Base class for handlers based on a DOMPropertySet. + */ + class SHIBSP_API AbstractHandler : public virtual Handler, public DOMPropertySet + { + protected: + /** + * Constructor + * + * @param e DOM element to load as property set. + * @param log logging category to use + * @param filter optional filter controls what child elements to include as nested PropertySets + * @param remapper optional map of property rename rules for legacy property support + */ + AbstractHandler( + const xercesc::DOMElement* e, + xmltooling::logging::Category& log, + xercesc::DOMNodeFilter* filter=NULL, + const std::map* remapper=NULL + ); + +#ifndef SHIBSP_LITE + /** + * Examines a protocol response message for errors and raises an annotated exception + * if an error is found. + * + *

The base class version understands SAML 1.x and SAML 2.0 responses. + * + * @param response a response message of some known protocol + * @param role issuer of message + */ + virtual void checkError( + const xmltooling::XMLObject* response, + const opensaml::saml2md::RoleDescriptor* role=NULL + ) const; + + /** + * Prepares Status information in a SAML 2.0 response. + * + * @param response SAML 2.0 response message + * @param code SAML status code + * @param subcode optional SAML substatus code + * @param msg optional message to pass back + */ + void fillStatus( + opensaml::saml2p::StatusResponseType& response, const XMLCh* code, const XMLCh* subcode=NULL, const char* msg=NULL + ) const; + + /** + * Encodes and sends SAML 2.0 message, optionally signing it in the process. + * If the method returns, the message MUST NOT be freed by the caller. + * + * @param encoder the MessageEncoder to use + * @param msg the message to send + * @param relayState any RelayState to include with the message + * @param destination location to send message, if not a backchannel response + * @param role recipient of message, if known + * @param application the Application sending the message + * @param httpResponse channel for sending message + * @param signIfPossible true iff signing should be attempted regardless of "signing" property + * @return the result of sending the message using the encoder + */ + long sendMessage( + const opensaml::MessageEncoder& encoder, + xmltooling::XMLObject* msg, + const char* relayState, + const char* destination, + const opensaml::saml2md::RoleDescriptor* role, + const Application& application, + xmltooling::HTTPResponse& httpResponse, + bool signIfPossible=false + ) const; +#endif + + /** + * Implements various mechanisms to preserve RelayState, + * such as cookies or StorageService-backed keys. + * + *

If a supported mechanism can be identified, the input parameter will be + * replaced with a suitable state key. + * + * @param application the associated Application + * @param response outgoing HTTP response + * @param relayState RelayState token to supply with message + */ + virtual void preserveRelayState( + const Application& application, xmltooling::HTTPResponse& response, std::string& relayState + ) const; + + /** + * Implements various mechanisms to recover RelayState, + * such as cookies or StorageService-backed keys. + * + *

If a supported mechanism can be identified, the input parameter will be + * replaced with the recovered state information. + * + * @param application the associated Application + * @param request incoming HTTP request + * @param response outgoing HTTP response + * @param relayState RelayState token supplied with message + * @param clear true iff the token state should be cleared + */ + virtual void recoverRelayState( + const Application& application, + const xmltooling::HTTPRequest& request, + xmltooling::HTTPResponse& response, + std::string& relayState, + bool clear=true + ) const; + + /** Logging object. */ + xmltooling::logging::Category& m_log; + + /** Configuration namespace for custom properties. */ + xmltooling::auto_ptr_char m_configNS; + + public: + virtual ~AbstractHandler() {} + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_abshandler_h__ */ diff --git a/shibsp/handler/AssertionConsumerService.h b/shibsp/handler/AssertionConsumerService.h new file mode 100644 index 0000000..a7289fe --- /dev/null +++ b/shibsp/handler/AssertionConsumerService.h @@ -0,0 +1,174 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/handler/AssertionConsumerService.h + * + * Base class for handlers that create sessions by consuming SSO protocol responses. + */ + +#ifndef __shibsp_acshandler_h__ +#define __shibsp_acshandler_h__ + +#include +#include +#ifndef SHIBSP_LITE +# include +# include +# include +#endif +#include + +namespace shibsp { + + class SHIBSP_API Attribute; + class SHIBSP_API ResolutionContext; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + /** + * Base class for handlers that create sessions by consuming SSO protocol responses. + */ + class SHIBSP_API AssertionConsumerService : public AbstractHandler, public RemotedHandler + { + public: + virtual ~AssertionConsumerService(); + + std::pair run(SPRequest& request, bool isHandler=true) const; + void receive(DDF& in, std::ostream& out); + + protected: + /** + * Constructor + * + * @param e root of DOM configuration + * @param appId ID of application that "owns" the handler + * @param log a logging object to use + */ + AssertionConsumerService(const xercesc::DOMElement* e, const char* appId, xmltooling::logging::Category& log); + + /** + * Enforce address checking requirements. + * + * @param application reference to application receiving message + * @param httpRequest client request that initiated session + * @param issuedTo address for which security assertion was issued + */ + void checkAddress(const Application& application, const xmltooling::HTTPRequest& httpRequest, const char* issuedTo) const; + +#ifndef SHIBSP_LITE + void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const; + + /** + * Implement protocol-specific handling of the incoming decoded message. + * + *

The result of implementing the protocol should be an exception or + * modifications to the request/response objects to reflect processing + * of the message. + * + * @param application reference to application receiving message + * @param httpRequest client request that included message + * @param httpResponse response to client + * @param policy the SecurityPolicy in effect, after having evaluated the message + * @param settings policy configuration settings in effect + * @param xmlObject a protocol-specific message object + */ + virtual void implementProtocol( + const Application& application, + const xmltooling::HTTPRequest& httpRequest, + xmltooling::HTTPResponse& httpResponse, + opensaml::SecurityPolicy& policy, + const PropertySet* settings, + const xmltooling::XMLObject& xmlObject + ) const=0; + + /** + * Extracts policy-relevant assertion details. + * + * @param assertion the incoming assertion + * @param protocol the protocol family in use + * @param policy SecurityPolicy to provide various components and track message data + */ + virtual void extractMessageDetails( + const opensaml::Assertion& assertion, const XMLCh* protocol, opensaml::SecurityPolicy& policy + ) const; + + /** + * Attempt SSO-initiated attribute resolution using the supplied information, + * including NameID and token extraction and filtering followed by + * secondary resolution. + * + *

The caller must free the returned context handle. + * + * @param application reference to application receiving message + * @param issuer source of SSO tokens + * @param protocol SSO protocol used + * @param v1nameid identifier of principal in SAML 1.x form, if any + * @param nameid identifier of principal in SAML 2.0 form + * @param authncontext_class method/category of authentication event, if known + * @param authncontext_decl specifics of authentication event, if known + * @param tokens available assertions, if any + */ + ResolutionContext* resolveAttributes( + const Application& application, + const opensaml::saml2md::RoleDescriptor* issuer=NULL, + const XMLCh* protocol=NULL, + const opensaml::saml1::NameIdentifier* v1nameid=NULL, + const opensaml::saml2::NameID* nameid=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL, + const std::vector* tokens=NULL + ) const; + + public: + const char* getType() const { + return "AssertionConsumerService"; + } + +#endif + private: + std::pair processMessage( + const Application& application, const xmltooling::HTTPRequest& httpRequest, xmltooling::HTTPResponse& httpResponse + ) const; + + std::pair sendRedirect( + const Application& application, + const xmltooling::HTTPRequest& request, + xmltooling::HTTPResponse& response, + const char* entityID, + const char* relayState + ) const; + + void maintainHistory( + const Application& application, const xmltooling::HTTPRequest& request, xmltooling::HTTPResponse& response, const char* entityID + ) const; + +#ifndef SHIBSP_LITE + opensaml::MessageDecoder* m_decoder; + xmltooling::QName m_role; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_acshandler_h__ */ diff --git a/shibsp/handler/Handler.h b/shibsp/handler/Handler.h new file mode 100644 index 0000000..a73b1ff --- /dev/null +++ b/shibsp/handler/Handler.h @@ -0,0 +1,94 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/handler/Handler.h + * + * Pluggable runtime functionality that implement protocols and services + */ + +#ifndef __shibsp_handler_h__ +#define __shibsp_handler_h__ + +#include +#ifndef SHIBSP_LITE +# include +#endif + +namespace shibsp { + + class SHIBSP_API SPRequest; + + /** + * Pluggable runtime functionality that implement protocols and services + */ + class SHIBSP_API Handler : public virtual PropertySet + { + MAKE_NONCOPYABLE(Handler); + protected: + Handler() {} + public: + virtual ~Handler() {} + + /** + * Executes handler functionality as an incoming request. + * + *

Handlers can be run either directly by incoming web requests + * or indirectly/implicitly during other SP processing. + * + * @param request SP request context + * @param isHandler true iff executing in the context of a direct handler invocation + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + virtual std::pair run(SPRequest& request, bool isHandler=true) const=0; + +#ifndef SHIBSP_LITE + /** + * Generates and/or modifies metadata reflecting the Handler. + * + *

The default implementation does nothing. + * + * @param role metadata role to decorate + * @param handlerURL base location of handler's endpoint + */ + virtual void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const { + } + + /** + * Returns the "type" of the Handler plugin. + * + * @return a Handler type + */ + virtual const char* getType() const { + return getString("type").second; + } +#endif + }; + + /** Registers Handler implementations. */ + void SHIBSP_API registerHandlers(); + + /** Handler for metadata generation. */ + #define METADATA_GENERATOR_HANDLER "MetadataGenerator" + + /** Handler for status information. */ + #define STATUS_HANDLER "Status" + + /** Handler for session diagnostic information. */ + #define SESSION_HANDLER "Session" +}; + +#endif /* __shibsp_handler_h__ */ diff --git a/shibsp/handler/LogoutHandler.h b/shibsp/handler/LogoutHandler.h new file mode 100644 index 0000000..7026563 --- /dev/null +++ b/shibsp/handler/LogoutHandler.h @@ -0,0 +1,142 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/handler/LogoutHandler.h + * + * Base class for logout-related handlers. + */ + +#ifndef __shibsp_logout_h__ +#define __shibsp_logout_h__ + +#include +#include + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + + /** + * Base class for logout-related handlers. + */ + class SHIBSP_API LogoutHandler : public RemotedHandler + { + public: + virtual ~LogoutHandler() {} + + /** + * The base method will iteratively attempt front-channel notification + * of logout of the current session, and after the final round trip will + * perform back-channel notification. Nothing will be done unless the + * handler detects that it is the "top" level logout handler. + * If the method returns false, then the specialized class should perform + * its work assuming that the notifications are completed. + * + * Note that the current session is NOT removed from the cache. + * + * @param request SP request context + * @param isHandler true iff executing in the context of a direct handler invocation + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + std::pair run(SPRequest& request, bool isHandler=true) const; + + /** + * A remoted procedure that will perform any necessary back-channel + * notifications. The input structure must contain an "application_id" member, + * and a "sessions" list containing the session keys, along with an integer + * member called "notify" with a value of 1. + * + * @param in incoming DDF message + * @param out stream to write outgoing DDF message to + */ + void receive(DDF& in, std::ostream& out); + + protected: + LogoutHandler() : m_initiator(true) {} + + /** Flag indicating whether the subclass is acting as a LogoutInitiator. */ + bool m_initiator; + + /** Array of query string parameters to preserve across front-channel notifications, if present. */ + std::vector m_preserve; + + /** + * Perform front-channel logout notifications for an Application. + * + * @param application the Application to notify + * @param request last request from browser + * @param response response to use for next notification + * @param params map of query string parameters to preserve across this notification + * @return indicator of a completed response along with the status code to return from the handler + */ + std::pair notifyFrontChannel( + const Application& application, + const xmltooling::HTTPRequest& request, + xmltooling::HTTPResponse& response, + const std::map* params=NULL + ) const; + + /** + * Perform back-channel logout notifications for an Application. + * + * @param application the Application to notify + * @param requestURL requestURL that resulted in method call + * @param sessions array of session keys being logged out + * @param local true iff the logout operation is local to the SP, false iff global + * @return true iff all notifications succeeded + */ + bool notifyBackChannel( + const Application& application, const char* requestURL, const std::vector& sessions, bool local + ) const; + + /** + * Sends a response template to the user agent informing it of the results of a logout attempt. + * + * @param application the Application to use in determining the logout template + * @param request the HTTP client request to supply to the template + * @param response the HTTP response to use + * @param local true iff the logout operation was local to the SP, false iff global + * @param status optional logoutStatus key value to add to template + */ + std::pair sendLogoutPage( + const Application& application, + const xmltooling::HTTPRequest& request, + xmltooling::HTTPResponse& response, + bool local=true, + const char* status=NULL + ) const; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + /** LogoutInitiator that iterates through a set of protocol-specific versions. */ + #define CHAINING_LOGOUT_INITIATOR "Chaining" + + /** LogoutInitiator that supports SAML 2.0 LogoutRequests. */ + #define SAML2_LOGOUT_INITIATOR "SAML2" + + /** LogoutInitiator that supports local-only logout. */ + #define LOCAL_LOGOUT_INITIATOR "Local" + +}; + +#endif /* __shibsp_logout_h__ */ diff --git a/shibsp/handler/RemotedHandler.h b/shibsp/handler/RemotedHandler.h new file mode 100644 index 0000000..37c6e53 --- /dev/null +++ b/shibsp/handler/RemotedHandler.h @@ -0,0 +1,92 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/handler/RemotedHandler.h + * + * Base class for handlers that need SP request/response layer to be remoted. + */ + +#ifndef __shibsp_remhandler_h__ +#define __shibsp_remhandler_h__ + +#include +#include +#include + +namespace shibsp { + + /** + * Base class for handlers that need HTTP request/response layer to be remoted. + */ + class SHIBSP_API RemotedHandler : public virtual Handler, public Remoted + { + public: + virtual ~RemotedHandler(); + + protected: + RemotedHandler() {} + + /** + * Establishes message remoting using the supplied address. + * + * @param address a unique "address" for remote message handling + */ + void setAddress(const char* address); + + /** + * Wraps a request by creating an outgoing data flow with the data needed + * to remote the request information. + * + * @param request an SPRequest to remote + * @param headers array of request headers to copy to remote request + * @param certs true iff client certificates should be available for the remote request + * @return the input dataflow object + */ + DDF wrap(const SPRequest& request, const std::vector* headers=NULL, bool certs=false) const; + + /** + * Unwraps a response by examining an incoming data flow to determine + * whether a response was produced by the remoted handler. + * + * @param request SP request context + * @param out the dataflow object to unpack + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + virtual std::pair unwrap(SPRequest& request, DDF& out) const; + + /** + * Builds a new request instance around a remoted data object. + * + * @param in the dataflow object containing the remoted request + * @return a call-specific request object based on the input, to be freed by the caller + */ + xmltooling::HTTPRequest* getRequest(DDF& in) const; + + /** + * Builds a new response instance around an outgoing data object. + * + * @param out the dataflow object to be returned by the caller + * @return a call-specific response object, to be freed by the caller + */ + xmltooling::HTTPResponse* getResponse(DDF& out) const; + + /** Message address for remote half. */ + std::string m_address; + }; +}; + +#endif /* __shibsp_remhandler_h__ */ diff --git a/shibsp/handler/SessionInitiator.h b/shibsp/handler/SessionInitiator.h new file mode 100644 index 0000000..ab19446 --- /dev/null +++ b/shibsp/handler/SessionInitiator.h @@ -0,0 +1,94 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/handler/SessionInitiator.h + * + * Pluggable runtime functionality that handles initiating sessions. + */ + +#ifndef __shibsp_initiator_h__ +#define __shibsp_initiator_h__ + +#include + +namespace shibsp { + + /** + * Pluggable runtime functionality that handles initiating sessions. + * + *

By default, SessionInitiators look for an entityID on the incoming request + * and pass control to the specialized run method. + */ + class SHIBSP_API SessionInitiator : public virtual Handler + { + protected: + SessionInitiator() {} + + public: + virtual ~SessionInitiator() {} + + /** + * Executes an incoming request. + * + *

SessionInitiators can be run either directly by incoming web requests + * or indirectly/implicitly during other SP processing. + * + * @param request SP request context + * @param entityID the name of an IdP to request a session from, if known + * @param isHandler true iff executing in the context of a direct handler invocation + * @return a pair containing a "request completed" indicator and a server-specific response code + */ + virtual std::pair run(SPRequest& request, std::string& entityID, bool isHandler=true) const=0; + + std::pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + const char* getType() const { + return "SessionInitiator"; + } +#endif + }; + + /** Registers SessionInitiator implementations. */ + void SHIBSP_API registerSessionInitiators(); + + /** SessionInitiator that iterates through a set of protocol-specific versions. */ + #define CHAINING_SESSION_INITIATOR "Chaining" + + /** SessionInitiator that supports SAML 2.0 AuthnRequests. */ + #define SAML2_SESSION_INITIATOR "SAML2" + + /** SessionInitiator that supports SAML Discovery Service protocol. */ + #define SAMLDS_SESSION_INITIATOR "SAMLDS" + + /** SessionInitiator that supports Shibboleth V1 AuthnRequest redirects. */ + #define SHIB1_SESSION_INITIATOR "Shib1" + + /** SessionInitiator that supports Shibboleth V1 WAYF redirects when no IdP is supplied. */ + #define WAYF_SESSION_INITIATOR "WAYF" + + /** SessionInitiator that attempts a sequence of transforms of an input until an entityID is found. */ + #define TRANSFORM_SESSION_INITIATOR "Transform" + + /** SessionInitiator that uses HTML form submission from the user. */ + #define FORM_SESSION_INITIATOR "Form" + + /** SessionInitiator that reads the CDC. */ + #define COOKIE_SESSION_INITIATOR "Cookie" +}; + +#endif /* __shibsp_initiator_h__ */ diff --git a/shibsp/handler/impl/AbstractHandler.cpp b/shibsp/handler/impl/AbstractHandler.cpp new file mode 100644 index 0000000..3f2e0da --- /dev/null +++ b/shibsp/handler/impl/AbstractHandler.cpp @@ -0,0 +1,389 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AbstractHandler.cpp + * + * Base class for handlers based on a DOMPropertySet. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/LogoutHandler.h" +#include "remoting/ListenerService.h" +#include "util/SPConstants.h" + +#ifndef SHIBSP_LITE +# include +# include +# include +# include +# include +# include +# include +# include +using namespace opensaml::saml2md; +#else +# include "lite/SAMLConstants.h" +#endif + +#include +#include + +using namespace shibsp; +using namespace samlconstants; +using namespace opensaml; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +namespace shibsp { + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory SAML1ConsumerFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory SAML2ConsumerFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory SAML2ArtifactResolutionFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory ChainingLogoutInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory LocalLogoutInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory SAML2LogoutInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory SAML2LogoutFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory SAML2NameIDMgmtFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory AssertionLookupFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory MetadataGeneratorFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory StatusHandlerFactory; + SHIBSP_DLLLOCAL PluginManager< Handler,string,pair >::Factory SessionHandlerFactory; +}; + +void SHIBSP_API shibsp::registerHandlers() +{ + SPConfig& conf=SPConfig::getConfig(); + + conf.AssertionConsumerServiceManager.registerFactory(SAML1_PROFILE_BROWSER_ARTIFACT, SAML1ConsumerFactory); + conf.AssertionConsumerServiceManager.registerFactory(SAML1_PROFILE_BROWSER_POST, SAML1ConsumerFactory); + conf.AssertionConsumerServiceManager.registerFactory(SAML20_BINDING_HTTP_POST, SAML2ConsumerFactory); + conf.AssertionConsumerServiceManager.registerFactory(SAML20_BINDING_HTTP_POST_SIMPLESIGN, SAML2ConsumerFactory); + conf.AssertionConsumerServiceManager.registerFactory(SAML20_BINDING_HTTP_ARTIFACT, SAML2ConsumerFactory); + conf.AssertionConsumerServiceManager.registerFactory(SAML20_BINDING_PAOS, SAML2ConsumerFactory); + + conf.ArtifactResolutionServiceManager.registerFactory(SAML20_BINDING_SOAP, SAML2ArtifactResolutionFactory); + + conf.HandlerManager.registerFactory(SAML20_BINDING_URI, AssertionLookupFactory); + conf.HandlerManager.registerFactory(METADATA_GENERATOR_HANDLER, MetadataGeneratorFactory); + conf.HandlerManager.registerFactory(STATUS_HANDLER, StatusHandlerFactory); + conf.HandlerManager.registerFactory(SESSION_HANDLER, SessionHandlerFactory); + + conf.LogoutInitiatorManager.registerFactory(CHAINING_LOGOUT_INITIATOR, ChainingLogoutInitiatorFactory); + conf.LogoutInitiatorManager.registerFactory(LOCAL_LOGOUT_INITIATOR, LocalLogoutInitiatorFactory); + conf.LogoutInitiatorManager.registerFactory(SAML2_LOGOUT_INITIATOR, SAML2LogoutInitiatorFactory); + conf.SingleLogoutServiceManager.registerFactory(SAML20_BINDING_SOAP, SAML2LogoutFactory); + conf.SingleLogoutServiceManager.registerFactory(SAML20_BINDING_HTTP_REDIRECT, SAML2LogoutFactory); + conf.SingleLogoutServiceManager.registerFactory(SAML20_BINDING_HTTP_POST, SAML2LogoutFactory); + conf.SingleLogoutServiceManager.registerFactory(SAML20_BINDING_HTTP_POST_SIMPLESIGN, SAML2LogoutFactory); + conf.SingleLogoutServiceManager.registerFactory(SAML20_BINDING_HTTP_ARTIFACT, SAML2LogoutFactory); + + conf.ManageNameIDServiceManager.registerFactory(SAML20_BINDING_SOAP, SAML2NameIDMgmtFactory); + conf.ManageNameIDServiceManager.registerFactory(SAML20_BINDING_HTTP_REDIRECT, SAML2NameIDMgmtFactory); + conf.ManageNameIDServiceManager.registerFactory(SAML20_BINDING_HTTP_POST, SAML2NameIDMgmtFactory); + conf.ManageNameIDServiceManager.registerFactory(SAML20_BINDING_HTTP_POST_SIMPLESIGN, SAML2NameIDMgmtFactory); + conf.ManageNameIDServiceManager.registerFactory(SAML20_BINDING_HTTP_ARTIFACT, SAML2NameIDMgmtFactory); +} + +AbstractHandler::AbstractHandler( + const DOMElement* e, Category& log, DOMNodeFilter* filter, const map* remapper + ) : m_log(log), m_configNS(shibspconstants::SHIB2SPCONFIG_NS) { + load(e,NULL,filter,remapper); +} + +#ifndef SHIBSP_LITE + +void AbstractHandler::checkError(const XMLObject* response, const saml2md::RoleDescriptor* role) const +{ + const saml2p::StatusResponseType* r2 = dynamic_cast(response); + if (r2) { + const saml2p::Status* status = r2->getStatus(); + if (status) { + const saml2p::StatusCode* sc = status->getStatusCode(); + const XMLCh* code = sc ? sc->getValue() : NULL; + if (code && !XMLString::equals(code,saml2p::StatusCode::SUCCESS)) { + FatalProfileException ex("SAML response contained an error."); + annotateException(&ex, role, status); // throws it + } + } + } + + const saml1p::Response* r1 = dynamic_cast(response); + if (r1) { + const saml1p::Status* status = r1->getStatus(); + if (status) { + const saml1p::StatusCode* sc = status->getStatusCode(); + const QName* code = sc ? sc->getValue() : NULL; + if (code && *code != saml1p::StatusCode::SUCCESS) { + FatalProfileException ex("SAML response contained an error."); + ex.addProperty("statusCode", code->toString().c_str()); + if (sc->getStatusCode()) { + code = sc->getStatusCode()->getValue(); + if (code) + ex.addProperty("statusCode2", code->toString().c_str()); + } + if (status->getStatusMessage()) { + auto_ptr_char msg(status->getStatusMessage()->getMessage()); + if (msg.get() && *msg.get()) + ex.addProperty("statusMessage", msg.get()); + } + ex.raise(); + } + } + } +} + +void AbstractHandler::fillStatus(saml2p::StatusResponseType& response, const XMLCh* code, const XMLCh* subcode, const char* msg) const +{ + saml2p::Status* status = saml2p::StatusBuilder::buildStatus(); + saml2p::StatusCode* scode = saml2p::StatusCodeBuilder::buildStatusCode(); + status->setStatusCode(scode); + scode->setValue(code); + if (subcode) { + saml2p::StatusCode* ssubcode = saml2p::StatusCodeBuilder::buildStatusCode(); + scode->setStatusCode(ssubcode); + ssubcode->setValue(subcode); + } + if (msg) { + pair flag = getBool("detailedErrors", m_configNS.get()); + auto_ptr_XMLCh widemsg((flag.first && flag.second) ? msg : "Error processing request."); + saml2p::StatusMessage* sm = saml2p::StatusMessageBuilder::buildStatusMessage(); + status->setStatusMessage(sm); + sm->setMessage(widemsg.get()); + } + response.setStatus(status); +} + +long AbstractHandler::sendMessage( + const MessageEncoder& encoder, + XMLObject* msg, + const char* relayState, + const char* destination, + const saml2md::RoleDescriptor* role, + const Application& application, + HTTPResponse& httpResponse, + bool signIfPossible + ) const +{ + const EntityDescriptor* entity = role ? dynamic_cast(role->getParent()) : NULL; + const PropertySet* relyingParty = application.getRelyingParty(entity); + pair flag = signIfPossible ? make_pair(true,(const char*)"true") : relyingParty->getString("signing"); + if (role && flag.first && + (!strcmp(flag.second, "true") || + (encoder.isUserAgentPresent() && !strcmp(flag.second, "front")) || + (!encoder.isUserAgentPresent() && !strcmp(flag.second, "back")))) { + CredentialResolver* credResolver=application.getCredentialResolver(); + if (credResolver) { + Locker credLocker(credResolver); + const Credential* cred = NULL; + pair keyName = relyingParty->getString("keyName"); + pair sigalg = relyingParty->getXMLString("signingAlg"); + if (role) { + MetadataCredentialCriteria mcc(*role); + mcc.setUsage(Credential::SIGNING_CREDENTIAL); + if (keyName.first) + mcc.getKeyNames().insert(keyName.second); + if (sigalg.first) + mcc.setXMLAlgorithm(sigalg.second); + cred = credResolver->resolve(&mcc); + } + else { + CredentialCriteria cc; + cc.setUsage(Credential::SIGNING_CREDENTIAL); + if (keyName.first) + cc.getKeyNames().insert(keyName.second); + if (sigalg.first) + cc.setXMLAlgorithm(sigalg.second); + cred = credResolver->resolve(&cc); + } + if (cred) { + // Signed request. + return encoder.encode( + httpResponse, + msg, + destination, + entity, + relayState, + &application, + cred, + sigalg.second, + relyingParty->getXMLString("digestAlg").second + ); + } + else { + m_log.warn("no signing credential resolved, leaving message unsigned"); + } + } + else { + m_log.warn("no credential resolver installed, leaving message unsigned"); + } + } + + // Unsigned request. + return encoder.encode(httpResponse, msg, destination, entity, relayState, &application); +} + +#endif + +void AbstractHandler::preserveRelayState(const Application& application, HTTPResponse& response, string& relayState) const +{ + if (relayState.empty()) + return; + + // No setting means just pass it by value. + pair mech=getString("relayState"); + if (!mech.first || !mech.second || !*mech.second) + return; + + if (!strcmp(mech.second, "cookie")) { + // Here we store the state in a cookie and send a fixed + // value so we can recognize it on the way back. + if (relayState != "cookie") { + const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder(); + pair shib_cookie=application.getCookieNameProps("_shibstate_"); + string stateval = urlenc->encode(relayState.c_str()) + shib_cookie.second; + response.setCookie(shib_cookie.first.c_str(),stateval.c_str()); + relayState = "cookie"; + } + } + else if (strstr(mech.second,"ss:")==mech.second) { + if (relayState.find("ss:")!=0) { + mech.second+=3; + if (*mech.second) { + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { +#ifndef SHIBSP_LITE + StorageService* storage = application.getServiceProvider().getStorageService(mech.second); + if (storage) { + string rsKey; + SAMLConfig::getConfig().generateRandomBytes(rsKey,10); + rsKey = SAMLArtifact::toHex(rsKey); + if (!storage->createString("RelayState", rsKey.c_str(), relayState.c_str(), time(NULL) + 600)) + throw IOException("Attempted to insert duplicate storage key."); + relayState = string(mech.second-3) + ':' + rsKey; + } + else { + m_log.error("Storage-backed RelayState with invalid StorageService ID (%s)", mech.second); + relayState.erase(); + } +#endif + } + else if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) { + DDF out,in = DDF("set::RelayState").structure(); + in.addmember("id").string(mech.second); + in.addmember("value").string(relayState.c_str()); + DDFJanitor jin(in),jout(out); + out = application.getServiceProvider().getListenerService()->send(in); + if (!out.isstring()) + throw IOException("StorageService-backed RelayState mechanism did not return a state key."); + relayState = string(mech.second-3) + ':' + out.string(); + } + } + } + } + else + throw ConfigurationException("Unsupported relayState mechanism ($1).", params(1,mech.second)); +} + +void AbstractHandler::recoverRelayState( + const Application& application, const HTTPRequest& request, HTTPResponse& response, string& relayState, bool clear + ) const +{ + SPConfig& conf = SPConfig::getConfig(); + + // Look for StorageService-backed state of the form "ss:SSID:key". + const char* state = relayState.c_str(); + if (strstr(state,"ss:")==state) { + state += 3; + const char* key = strchr(state,':'); + if (key) { + string ssid = relayState.substr(3, key - state); + key++; + if (!ssid.empty() && *key) { + if (conf.isEnabled(SPConfig::OutOfProcess)) { +#ifndef SHIBSP_LITE + StorageService* storage = conf.getServiceProvider()->getStorageService(ssid.c_str()); + if (storage) { + ssid = key; + if (storage->readString("RelayState",ssid.c_str(),&relayState)>0) { + if (clear) + storage->deleteString("RelayState",ssid.c_str()); + return; + } + else + relayState.erase(); + } + else { + Category::getInstance(SHIBSP_LOGCAT".Handler").error( + "Storage-backed RelayState with invalid StorageService ID (%s)", ssid.c_str() + ); + relayState.erase(); + } +#endif + } + else if (conf.isEnabled(SPConfig::InProcess)) { + DDF out,in = DDF("get::RelayState").structure(); + in.addmember("id").string(ssid.c_str()); + in.addmember("key").string(key); + in.addmember("clear").integer(clear ? 1 : 0); + DDFJanitor jin(in),jout(out); + out = application.getServiceProvider().getListenerService()->send(in); + if (!out.isstring()) { + m_log.error("StorageService-backed RelayState mechanism did not return a state value."); + relayState.erase(); + } + else { + relayState = out.string(); + return; + } + } + } + } + } + + if (relayState == "cookie") { + // Pull the value from the "relay state" cookie. + pair relay_cookie = application.getCookieNameProps("_shibstate_"); + const char* state = request.getCookie(relay_cookie.first.c_str()); + if (state && *state) { + // URL-decode the value. + char* rscopy=strdup(state); + XMLToolingConfig::getConfig().getURLEncoder()->decode(rscopy); + relayState = rscopy; + free(rscopy); + + if (clear) + response.setCookie(relay_cookie.first.c_str(),relay_cookie.second); + return; + } + + relayState.erase(); + } + + // Check for "default" value. + if (relayState.empty() || relayState == "default") { + pair homeURL=application.getString("homeURL"); + relayState=homeURL.first ? homeURL.second : "/"; + return; + } + + if (relayState == "default") + relayState.empty(); +} diff --git a/shibsp/handler/impl/AssertionConsumerService.cpp b/shibsp/handler/impl/AssertionConsumerService.cpp new file mode 100644 index 0000000..f4863cd --- /dev/null +++ b/shibsp/handler/impl/AssertionConsumerService.cpp @@ -0,0 +1,467 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AssertionConsumerService.cpp + * + * Base class for handlers that create sessions by consuming SSO protocol responses. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "handler/AssertionConsumerService.h" +#include "util/SPConstants.h" + +# include +#ifndef SHIBSP_LITE +# include "attribute/Attribute.h" +# include "attribute/filtering/AttributeFilter.h" +# include "attribute/filtering/BasicFilteringContext.h" +# include "attribute/resolver/AttributeExtractor.h" +# include "attribute/resolver/AttributeResolver.h" +# include "attribute/resolver/ResolutionContext.h" +# include "security/SecurityPolicy.h" +# include +# include +# include +using namespace samlconstants; +using opensaml::saml2md::MetadataProvider; +using opensaml::saml2md::RoleDescriptor; +using opensaml::saml2md::EntityDescriptor; +using opensaml::saml2md::IDPSSODescriptor; +using opensaml::saml2md::SPSSODescriptor; +#else +# include "lite/CommonDomainCookie.h" +#endif + +using namespace shibspconstants; +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +AssertionConsumerService::AssertionConsumerService(const DOMElement* e, const char* appId, Category& log) + : AbstractHandler(e, log) +#ifndef SHIBSP_LITE + ,m_decoder(NULL), m_role(samlconstants::SAML20MD_NS, opensaml::saml2md::IDPSSODescriptor::LOCAL_NAME) +#endif +{ + if (!e) + return; + string address(appId); + address += getString("Location").second; + setAddress(address.c_str()); +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + m_decoder = SAMLConfig::getConfig().MessageDecoderManager.newPlugin( + getString("Binding").second, pair(e,shibspconstants::SHIB2SPCONFIG_NS) + ); + m_decoder->setArtifactResolver(SPConfig::getConfig().getArtifactResolver()); + } +#endif +} + +AssertionConsumerService::~AssertionConsumerService() +{ +#ifndef SHIBSP_LITE + delete m_decoder; +#endif +} + +pair AssertionConsumerService::run(SPRequest& request, bool isHandler) const +{ + string relayState; + SPConfig& conf = SPConfig::getConfig(); + + if (conf.isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively and directly process the message. + return processMessage(request.getApplication(), request, request); + } + else { + // When not out of process, we remote all the message processing. + vector headers(1, "Cookie"); + DDF out,in = wrap(request, &headers); + DDFJanitor jin(in), jout(out); + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } +} + +void AssertionConsumerService::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for new session", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for new session, deleted?"); + } + + // Unpack the request. + auto_ptr req(getRequest(in)); + + // Wrap a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + // Since we're remoted, the result should either be a throw, a false/0 return, + // which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + processMessage(*app, *req.get(), *resp.get()); + out << ret; +} + +pair AssertionConsumerService::processMessage( + const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse + ) const +{ +#ifndef SHIBSP_LITE + // Locate policy key. + pair policyId = getString("policyId", m_configNS.get()); // namespace-qualified if inside handler element + if (!policyId.first) + policyId = application.getString("policyId"); // unqualified in Application(s) element + + // Access policy properties. + const PropertySet* settings = application.getServiceProvider().getPolicySettings(policyId.second); + pair validate = settings->getBool("validate"); + + // Lock metadata for use by policy. + Locker metadataLocker(application.getMetadataProvider()); + + // Create the policy. + shibsp::SecurityPolicy policy(application, &m_role, validate.first && validate.second); + + string relayState; + + try { + // Decode the message and process it in a protocol-specific way. + auto_ptr msg(m_decoder->decode(relayState, httpRequest, policy)); + if (!msg.get()) + throw BindingException("Failed to decode an SSO protocol response."); + recoverRelayState(application, httpRequest, httpResponse, relayState); + implementProtocol(application, httpRequest, httpResponse, policy, settings, *msg.get()); + + auto_ptr_char issuer(policy.getIssuer() ? policy.getIssuer()->getName() : NULL); + + // History cookie. + if (issuer.get() && *issuer.get()) + maintainHistory(application, httpRequest, httpResponse, issuer.get()); + + // Now redirect to the state value. By now, it should be set to *something* usable. + return make_pair(true, httpResponse.sendRedirect(relayState.c_str())); + } + catch (XMLToolingException& ex) { + if (!relayState.empty()) + ex.addProperty("RelayState", relayState.c_str()); + throw; + } +#else + throw ConfigurationException("Cannot process message using lite version of shibsp library."); +#endif +} + +void AssertionConsumerService::checkAddress(const Application& application, const HTTPRequest& httpRequest, const char* issuedTo) const +{ + if (!issuedTo || !*issuedTo) + return; + + const PropertySet* props=application.getPropertySet("Sessions"); + pair checkAddress = props ? props->getBool("checkAddress") : make_pair(false,true); + if (!checkAddress.first) + checkAddress.second=true; + + if (checkAddress.second) { + m_log.debug("checking client address"); + if (httpRequest.getRemoteAddr() != issuedTo) { + throw FatalProfileException( + "Your client's current address ($client_addr) differs from the one used when you authenticated " + "to your identity provider. To correct this problem, you may need to bypass a proxy server. " + "Please contact your local support staff or help desk for assistance.", + namedparams(1,"client_addr",httpRequest.getRemoteAddr().c_str()) + ); + } + } +} + +#ifndef SHIBSP_LITE + +void AssertionConsumerService::generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + const char* loc = getString("Location").second; + string hurl(handlerURL); + if (*loc != '/') + hurl += '/'; + hurl += loc; + auto_ptr_XMLCh widen(hurl.c_str()); + saml2md::AssertionConsumerService* ep = saml2md::AssertionConsumerServiceBuilder::buildAssertionConsumerService(); + ep->setLocation(widen.get()); + ep->setBinding(getXMLString("Binding").second); + if (!strncmp(handlerURL, "https", 5)) { + pair index = getXMLString("sslIndex", shibspconstants::ASCII_SHIB2SPCONFIG_NS); + if (index.first) + ep->setIndex(index.second); + else + ep->setIndex(getXMLString("index").second); + } + else { + ep->setIndex(getXMLString("index").second); + } + role.getAssertionConsumerServices().push_back(ep); +} + +class SHIBSP_DLLLOCAL DummyContext : public ResolutionContext +{ +public: + DummyContext(const vector& attributes) : m_attributes(attributes) { + } + + virtual ~DummyContext() { + for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup()); + } + + vector& getResolvedAttributes() { + return m_attributes; + } + vector& getResolvedAssertions() { + return m_tokens; + } + +private: + vector m_attributes; + static vector m_tokens; // never any tokens, so just share an empty vector +}; + +vector DummyContext::m_tokens; + +ResolutionContext* AssertionConsumerService::resolveAttributes( + const Application& application, + const saml2md::RoleDescriptor* issuer, + const XMLCh* protocol, + const saml1::NameIdentifier* v1nameid, + const saml2::NameID* nameid, + const XMLCh* authncontext_class, + const XMLCh* authncontext_decl, + const vector* tokens + ) const +{ + const saml2md::EntityDescriptor* entity = issuer ? dynamic_cast(issuer->getParent()) : NULL; + + // First we do the extraction of any pushed information, including from metadata. + vector resolvedAttributes; + AttributeExtractor* extractor = application.getAttributeExtractor(); + if (extractor) { + Locker extlocker(extractor); + if (entity) { + pair mprefix = application.getString("metadataAttributePrefix"); + if (mprefix.first) { + m_log.debug("extracting metadata-derived attributes..."); + try { + extractor->extractAttributes(application, issuer, *entity, resolvedAttributes); + for (vector::iterator a = resolvedAttributes.begin(); a != resolvedAttributes.end(); ++a) { + vector& ids = (*a)->getAliases(); + for (vector::iterator id = ids.begin(); id != ids.end(); ++id) + *id = mprefix.second + *id; + } + } + catch (exception& ex) { + m_log.error("caught exception extracting attributes: %s", ex.what()); + } + } + } + m_log.debug("extracting pushed attributes..."); + if (v1nameid) { + try { + extractor->extractAttributes(application, issuer, *v1nameid, resolvedAttributes); + } + catch (exception& ex) { + m_log.error("caught exception extracting attributes: %s", ex.what()); + } + } + else if (nameid) { + try { + extractor->extractAttributes(application, issuer, *nameid, resolvedAttributes); + } + catch (exception& ex) { + m_log.error("caught exception extracting attributes: %s", ex.what()); + } + } + if (tokens) { + for (vector::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) { + try { + extractor->extractAttributes(application, issuer, *(*t), resolvedAttributes); + } + catch (exception& ex) { + m_log.error("caught exception extracting attributes: %s", ex.what()); + } + } + } + + AttributeFilter* filter = application.getAttributeFilter(); + if (filter && !resolvedAttributes.empty()) { + BasicFilteringContext fc(application, resolvedAttributes, issuer, authncontext_class); + Locker filtlocker(filter); + try { + filter->filterAttributes(fc, resolvedAttributes); + } + catch (exception& ex) { + m_log.error("caught exception filtering attributes: %s", ex.what()); + m_log.error("dumping extracted attributes due to filtering exception"); + for_each(resolvedAttributes.begin(), resolvedAttributes.end(), xmltooling::cleanup()); + resolvedAttributes.clear(); + } + } + } + + try { + AttributeResolver* resolver = application.getAttributeResolver(); + if (resolver) { + m_log.debug("resolving attributes..."); + + Locker locker(resolver); + auto_ptr ctx( + resolver->createResolutionContext( + application, + entity, + protocol, + nameid, + authncontext_class, + authncontext_decl, + tokens, + &resolvedAttributes + ) + ); + resolver->resolveAttributes(*ctx.get()); + // Copy over any pushed attributes. + if (!resolvedAttributes.empty()) + ctx->getResolvedAttributes().insert(ctx->getResolvedAttributes().end(), resolvedAttributes.begin(), resolvedAttributes.end()); + + // Attach global prefix if needed. + pair prefix = application.getString("attributePrefix"); + if (prefix.first) { + for (vector::iterator a = ctx->getResolvedAttributes().begin(); a != ctx->getResolvedAttributes().end(); ++a) { + vector& ids = (*a)->getAliases(); + for (vector::iterator id = ids.begin(); id != ids.end(); ++id) + *id = prefix.second + *id; + } + } + + return ctx.release(); + } + } + catch (exception& ex) { + m_log.error("attribute resolution failed: %s", ex.what()); + } + + if (!resolvedAttributes.empty()) { + // Attach global prefix if needed. + pair prefix = application.getString("attributePrefix"); + if (prefix.first) { + for (vector::iterator a = resolvedAttributes.begin(); a != resolvedAttributes.end(); ++a) { + vector& ids = (*a)->getAliases(); + for (vector::iterator id = ids.begin(); id != ids.end(); ++id) + *id = prefix.second + *id; + } + } + + return new DummyContext(resolvedAttributes); + } + return NULL; +} + +void AssertionConsumerService::extractMessageDetails(const Assertion& assertion, const XMLCh* protocol, opensaml::SecurityPolicy& policy) const +{ + policy.setMessageID(assertion.getID()); + policy.setIssueInstant(assertion.getIssueInstantEpoch()); + + if (XMLString::equals(assertion.getElementQName().getNamespaceURI(), samlconstants::SAML20_NS)) { + const saml2::Assertion* a2 = dynamic_cast(&assertion); + if (a2) { + m_log.debug("extracting issuer from SAML 2.0 assertion"); + policy.setIssuer(a2->getIssuer()); + } + } + else { + const saml1::Assertion* a1 = dynamic_cast(&assertion); + if (a1) { + m_log.debug("extracting issuer from SAML 1.x assertion"); + policy.setIssuer(a1->getIssuer()); + } + } + + if (policy.getIssuer() && !policy.getIssuerMetadata() && policy.getMetadataProvider()) { + if (policy.getIssuer()->getFormat() && !XMLString::equals(policy.getIssuer()->getFormat(), saml2::NameIDType::ENTITY)) { + m_log.warn("non-system entity issuer, skipping metadata lookup"); + return; + } + m_log.debug("searching metadata for assertion issuer..."); + MetadataProvider::Criteria mc(policy.getIssuer()->getName(), &IDPSSODescriptor::ELEMENT_QNAME, protocol); + pair entity = policy.getMetadataProvider()->getEntityDescriptor(mc); + if (!entity.first) { + auto_ptr_char iname(policy.getIssuer()->getName()); + m_log.warn("no metadata found, can't establish identity of issuer (%s)", iname.get()); + } + else if (!entity.second) { + m_log.warn("unable to find compatible IdP role in metadata"); + } + else { + policy.setIssuerMetadata(entity.second); + } + } +} + +#endif + +void AssertionConsumerService::maintainHistory( + const Application& application, const HTTPRequest& request, HTTPResponse& response, const char* entityID + ) const +{ + static const char* defProps="; path=/"; + + const PropertySet* sessionProps=application.getPropertySet("Sessions"); + pair idpHistory=sessionProps->getBool("idpHistory"); + + if (!idpHistory.first || idpHistory.second) { + pair cookieProps=sessionProps->getString("cookieProps"); + if (!cookieProps.first) + cookieProps.second=defProps; + + // Set an IdP history cookie locally (essentially just a CDC). + CommonDomainCookie cdc(request.getCookie(CommonDomainCookie::CDCName)); + + // Either leave in memory or set an expiration. + pair days=sessionProps->getUnsignedInt("idpHistoryDays"); + if (!days.first || days.second==0) { + string c = string(cdc.set(entityID)) + cookieProps.second; + response.setCookie(CommonDomainCookie::CDCName, c.c_str()); + } + else { + time_t now=time(NULL) + (days.second * 24 * 60 * 60); +#ifdef HAVE_GMTIME_R + struct tm res; + struct tm* ptime=gmtime_r(&now,&res); +#else + struct tm* ptime=gmtime(&now); +#endif + char timebuf[64]; + strftime(timebuf,64,"%a, %d %b %Y %H:%M:%S GMT",ptime); + string c = string(cdc.set(entityID)) + cookieProps.second + "; expires=" + timebuf; + response.setCookie(CommonDomainCookie::CDCName, c.c_str()); + } + } +} diff --git a/shibsp/handler/impl/AssertionLookup.cpp b/shibsp/handler/impl/AssertionLookup.cpp new file mode 100644 index 0000000..990d7d7 --- /dev/null +++ b/shibsp/handler/impl/AssertionLookup.cpp @@ -0,0 +1,207 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * AssertionLookup.cpp + * + * Handler for looking assertions in SessionCache + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "SessionCacheEx.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" +#include "util/SPConstants.h" + +using namespace shibspconstants; +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + }; + + static SHIBSP_DLLLOCAL Blocker g_Blocker; + + class SHIBSP_API AssertionLookup : public AbstractHandler, public RemotedHandler + { + public: + AssertionLookup(const DOMElement* e, const char* appId); + virtual ~AssertionLookup() {} + + pair run(SPRequest& request, bool isHandler=true) const; + void receive(DDF& in, ostream& out); + + const char* getType() const { + return "AssertionLookup"; + } + + private: + pair processMessage(const Application& application, HTTPRequest& httpRequest, HTTPResponse& httpResponse) const; + + set m_acl; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL AssertionLookupFactory(const pair& p) + { + return new AssertionLookup(p.first, p.second); + } + +}; + +AssertionLookup::AssertionLookup(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".AssertionLookup"), &g_Blocker) +{ + setAddress("run::AssertionLookup"); + if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) { + pair acl = getString("exportACL"); + if (!acl.first) { + m_acl.insert("127.0.0.1"); + return; + } + string aclbuf=acl.second; + int j = 0; + for (unsigned int i=0; i < aclbuf.length(); i++) { + if (aclbuf.at(i)==' ') { + m_acl.insert(aclbuf.substr(j, i-j)); + j = i+1; + } + } + m_acl.insert(aclbuf.substr(j, aclbuf.length()-j)); + } +} + +pair AssertionLookup::run(SPRequest& request, bool isHandler) const +{ + string relayState; + SPConfig& conf = SPConfig::getConfig(); + if (conf.isEnabled(SPConfig::InProcess)) { + if (m_acl.count(request.getRemoteAddr()) == 0) { + m_log.error("request for assertion lookup blocked from invalid address (%s)", request.getRemoteAddr().c_str()); + istringstream msg("Assertion Lookup Blocked"); + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_UNAUTHORIZED)); + } + } + + try { + if (conf.isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively and directly process the message. + return processMessage(request.getApplication(), request, request); + } + else { + // When not out of process, we remote all the message processing. + DDF out,in = wrap(request); + DDFJanitor jin(in), jout(out); + + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } + } + catch (exception& ex) { + m_log.error("error while processing request: %s", ex.what()); + istringstream msg("Assertion Lookup Failed"); + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR)); + } +} + +void AssertionLookup::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for assertion lookup", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for assertion lookup, deleted?"); + } + + // Unpack the request. + auto_ptr req(getRequest(in)); + //m_log.debug("found %d client certificates", req->getClientCertificates().size()); + + // Wrap a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + // Since we're remoted, the result should either be a throw, a false/0 return, + // which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + processMessage(*app, *req.get(), *resp.get()); + out << ret; +} + +pair AssertionLookup::processMessage(const Application& application, HTTPRequest& httpRequest, HTTPResponse& httpResponse) const +{ +#ifndef SHIBSP_LITE + const char* key = httpRequest.getParameter("key"); + const char* ID = httpRequest.getParameter("ID"); + if (!key || !*key || !ID || !*ID) { + m_log.error("assertion lookup request failed, missing required parameters"); + throw FatalProfileException("Missing key or ID parameters."); + } + + m_log.debug("processing assertion lookup request (session: %s, assertion: %s)", key, ID); + + SessionCacheEx* cache = dynamic_cast(application.getServiceProvider().getSessionCache()); + if (!cache) { + m_log.error("session cache does not support extended API"); + throw FatalProfileException("Session cache does not support assertion lookup."); + } + + // The cache will either silently pass a session or NULL back, or throw an exception out. + Session* session = cache->find(application, key); + if (!session) { + m_log.error("valid session (%s) not found for assertion lookup", key); + throw FatalProfileException("Session key not found."); + } + + Locker locker(session, false); + + const Assertion* assertion = session->getAssertion(ID); + if (!assertion) { + m_log.error("assertion (%s) not found in session (%s)", ID, key); + throw FatalProfileException("Assertion not found."); + } + + stringstream s; + s << *assertion; + httpResponse.setContentType("application/samlassertion+xml"); + return make_pair(true, httpResponse.sendResponse(s)); +#else + return make_pair(false,0L); +#endif +} diff --git a/shibsp/handler/impl/ChainingLogoutInitiator.cpp b/shibsp/handler/impl/ChainingLogoutInitiator.cpp new file mode 100644 index 0000000..e8de4d6 --- /dev/null +++ b/shibsp/handler/impl/ChainingLogoutInitiator.cpp @@ -0,0 +1,128 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ChainingLogoutInitiator.cpp + * + * Chains together multiple LogoutInitiator handlers in sequence. + */ + +#include "internal.h" +#include "exceptions.h" +#include "handler/AbstractHandler.h" +#include "handler/LogoutHandler.h" +#include "util/SPConstants.h" + +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL ChainingLogoutInitiator : public AbstractHandler, public LogoutHandler + { + public: + ChainingLogoutInitiator(const DOMElement* e, const char* appId); + virtual ~ChainingLogoutInitiator() { + for_each(m_handlers.begin(), m_handlers.end(), xmltooling::cleanup()); + } + + pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + const char* getType() const { + return "LogoutInitiator"; + } + + void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const { + for (vector::const_iterator i = m_handlers.begin(); i!=m_handlers.end(); ++i) + (*i)->generateMetadata(role, handlerURL); + } +#endif + + private: + vector m_handlers; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + static const XMLCh _LogoutInitiator[] = UNICODE_LITERAL_15(L,o,g,o,u,t,I,n,i,t,i,a,t,o,r); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + + class SHIBSP_DLLLOCAL LogoutInitiatorNodeFilter : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + if (XMLHelper::isNodeNamed(node,shibspconstants::SHIB2SPCONFIG_NS,_LogoutInitiator)) + return FILTER_REJECT; + return FILTER_ACCEPT; + } + }; + + static SHIBSP_DLLLOCAL LogoutInitiatorNodeFilter g_LINFilter; + + Handler* SHIBSP_DLLLOCAL ChainingLogoutInitiatorFactory(const pair& p) + { + return new ChainingLogoutInitiator(p.first, p.second); + } +}; + +ChainingLogoutInitiator::ChainingLogoutInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".LogoutInitiator.Chaining"), &g_LINFilter) +{ + SPConfig& conf = SPConfig::getConfig(); + + // Load up the chain of handlers. + e = e ? XMLHelper::getFirstChildElement(e, _LogoutInitiator) : NULL; + while (e) { + auto_ptr_char type(e->getAttributeNS(NULL,_type)); + if (type.get() && *(type.get())) { + try { + m_handlers.push_back(conf.LogoutInitiatorManager.newPlugin(type.get(),make_pair(e, appId))); + m_handlers.back()->setParent(this); + } + catch (exception& ex) { + m_log.error("caught exception processing embedded LogoutInitiator element: %s", ex.what()); + } + } + e = XMLHelper::getNextSiblingElement(e, _LogoutInitiator); + } +} + +pair ChainingLogoutInitiator::run(SPRequest& request, bool isHandler) const +{ + // Defer to base class first. + pair ret = LogoutHandler::run(request, isHandler); + if (ret.first) + return ret; + + for (vector::const_iterator i = m_handlers.begin(); i!=m_handlers.end(); ++i) { + ret = (*i)->run(request, isHandler); + if (ret.first) + return ret; + } + throw ConfigurationException("None of the configured LogoutInitiators handled the request."); +} diff --git a/shibsp/handler/impl/ChainingSessionInitiator.cpp b/shibsp/handler/impl/ChainingSessionInitiator.cpp new file mode 100644 index 0000000..dcd29d6 --- /dev/null +++ b/shibsp/handler/impl/ChainingSessionInitiator.cpp @@ -0,0 +1,120 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ChainingSessionInitiator.cpp + * + * Chains together multiple SessionInitiator handlers in sequence. + */ + +#include "internal.h" +#include "exceptions.h" +#include "handler/AbstractHandler.h" +#include "handler/SessionInitiator.h" +#include "util/SPConstants.h" + +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL ChainingSessionInitiator : public SessionInitiator, public AbstractHandler + { + public: + ChainingSessionInitiator(const DOMElement* e, const char* appId); + virtual ~ChainingSessionInitiator() { + for_each(m_handlers.begin(), m_handlers.end(), xmltooling::cleanup()); + } + + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const { + for (vector::const_iterator i = m_handlers.begin(); i!=m_handlers.end(); ++i) + (*i)->generateMetadata(role, handlerURL); + } +#endif + + private: + vector m_handlers; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + static const XMLCh _SessionInitiator[] = UNICODE_LITERAL_16(S,e,s,s,i,o,n,I,n,i,t,i,a,t,o,r); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + + class SHIBSP_DLLLOCAL SessionInitiatorNodeFilter : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + if (XMLHelper::isNodeNamed(node,shibspconstants::SHIB2SPCONFIG_NS,_SessionInitiator)) + return FILTER_REJECT; + return FILTER_ACCEPT; + } + }; + + static SHIBSP_DLLLOCAL SessionInitiatorNodeFilter g_SINFilter; + + SessionInitiator* SHIBSP_DLLLOCAL ChainingSessionInitiatorFactory(const pair& p) + { + return new ChainingSessionInitiator(p.first, p.second); + } +}; + +ChainingSessionInitiator::ChainingSessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.Chaining"), &g_SINFilter) +{ + SPConfig& conf = SPConfig::getConfig(); + + // Load up the chain of handlers. + e = e ? XMLHelper::getFirstChildElement(e, _SessionInitiator) : NULL; + while (e) { + auto_ptr_char type(e->getAttributeNS(NULL,_type)); + if (type.get() && *(type.get())) { + try { + m_handlers.push_back(conf.SessionInitiatorManager.newPlugin(type.get(),make_pair(e, appId))); + m_handlers.back()->setParent(this); + } + catch (exception& ex) { + m_log.error("caught exception processing embedded SessionInitiator element: %s", ex.what()); + } + } + e = XMLHelper::getNextSiblingElement(e, _SessionInitiator); + } +} + +pair ChainingSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + pair ret; + for (vector::const_iterator i = m_handlers.begin(); i!=m_handlers.end(); ++i) { + ret = (*i)->run(request, entityID, isHandler); + if (ret.first) + return ret; + } + throw ConfigurationException("None of the configured SessionInitiators handled the request."); +} diff --git a/shibsp/handler/impl/CookieSessionInitiator.cpp b/shibsp/handler/impl/CookieSessionInitiator.cpp new file mode 100644 index 0000000..b79ed15 --- /dev/null +++ b/shibsp/handler/impl/CookieSessionInitiator.cpp @@ -0,0 +1,90 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * CookieSessionInitiator.cpp + * + * Cookie-based IdP discovery. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/SessionInitiator.h" + +#ifndef SHIBSP_LITE +# include +#else +# include "lite/CommonDomainCookie.h" +#endif + +#include +#include + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL CookieSessionInitiator : public SessionInitiator, public AbstractHandler + { + public: + CookieSessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.Cookie")), m_followMultiple(getBool("followMultiple").second) { + } + virtual ~CookieSessionInitiator() {} + + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + + private: + bool m_followMultiple; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* SHIBSP_DLLLOCAL CookieSessionInitiatorFactory(const pair& p) + { + return new CookieSessionInitiator(p.first, p.second); + } + +}; + +pair CookieSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + // The IdP CANNOT be specified for us to run. + if (!entityID.empty()) + return make_pair(false,0L); + + // If there's no entityID yet, we can check for cookie processing. + CommonDomainCookie cdc(request.getCookie(CommonDomainCookie::CDCName)); + if ((m_followMultiple && cdc.get().size() > 0) || (!m_followMultiple && cdc.get().size() == 1)) { + entityID = cdc.get().back(); + m_log.info("set entityID (%s) from IdP history cookie", entityID.c_str()); + } + + return make_pair(false,0L); +} diff --git a/shibsp/handler/impl/FormSessionInitiator.cpp b/shibsp/handler/impl/FormSessionInitiator.cpp new file mode 100644 index 0000000..53f6008 --- /dev/null +++ b/shibsp/handler/impl/FormSessionInitiator.cpp @@ -0,0 +1,123 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * FormSessionInitiator.cpp + * + * HTML form-based IdP discovery. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/SessionInitiator.h" +#include "util/TemplateParameters.h" + +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL FormSessionInitiator : public SessionInitiator, public AbstractHandler + { + public: + FormSessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.Form")), m_template(getString("template").second) { + if (!m_template) + throw ConfigurationException("Form SessionInitiator requires a template property."); + } + virtual ~FormSessionInitiator() {} + + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + + private: + const char* m_template; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* SHIBSP_DLLLOCAL FormSessionInitiatorFactory(const pair& p) + { + return new FormSessionInitiator(p.first, p.second); + } + +}; + +pair FormSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + string target; + const char* option; + const Application& app=request.getApplication(); + + if (isHandler) { + option = request.getParameter("target"); + if (option) + target = option; + recoverRelayState(app, request, request, target, false); + } + else { + // We're running as a "virtual handler" from within the filter. + // The target resource is the current one. + target=request.getRequestURL(); + } + + // Compute the return URL. We start with a self-referential link. + string returnURL=request.getHandlerURL(target.c_str()); + pair thisloc = getString("Location"); + if (thisloc.first) returnURL += thisloc.second; + + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + option = request.getParameter("target"); + if (option) + target = option; + } + preserveRelayState(app, request, target); + + request.setContentType("text/html"); + request.setResponseHeader("Expires","01-Jan-1997 12:00:00 GMT"); + request.setResponseHeader("Cache-Control","private,no-store,no-cache"); + string fname(m_template); + ifstream infile(XMLToolingConfig::getConfig().getPathResolver()->resolve(fname, PathResolver::XMLTOOLING_CFG_FILE).c_str()); + if (!infile) + throw ConfigurationException("Unable to access HTML template ($1).", params(1, m_template)); + TemplateParameters tp; + tp.m_request = &request; + tp.setPropertySet(app.getPropertySet("Errors")); + tp.m_map["action"] = returnURL; + if (!target.empty()) + tp.m_map["target"] = target; + stringstream str; + XMLToolingConfig::getConfig().getTemplateEngine()->run(infile, str, tp); + return make_pair(true,request.sendResponse(str)); +} diff --git a/shibsp/handler/impl/LocalLogoutInitiator.cpp b/shibsp/handler/impl/LocalLogoutInitiator.cpp new file mode 100644 index 0000000..6850bec --- /dev/null +++ b/shibsp/handler/impl/LocalLogoutInitiator.cpp @@ -0,0 +1,117 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LocalLogoutInitiator.cpp + * + * Logs out a session locally. + */ + +#include "internal.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "handler/AbstractHandler.h" +#include "handler/LogoutHandler.h" + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL LocalLogoutInitiator : public AbstractHandler, public LogoutHandler + { + public: + LocalLogoutInitiator(const DOMElement* e, const char* appId); + virtual ~LocalLogoutInitiator() {} + + void setParent(const PropertySet* parent); + pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + const char* getType() const { + return "LogoutInitiator"; + } +#endif + + private: + string m_appId; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL LocalLogoutInitiatorFactory(const pair& p) + { + return new LocalLogoutInitiator(p.first, p.second); + } +}; + +LocalLogoutInitiator::LocalLogoutInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".LogoutInitiator.Local")), m_appId(appId) +{ + pair loc = getString("Location"); + if (loc.first) { + string address = string(appId) + loc.second + "::run::LocalLI"; + setAddress(address.c_str()); + } +} + +void LocalLogoutInitiator::setParent(const PropertySet* parent) +{ + DOMPropertySet::setParent(parent); + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::LocalLI"; + setAddress(address.c_str()); + } + else { + m_log.warn("no Location property in Local LogoutInitiator (or parent), can't register as remoted handler"); + } +} + +pair LocalLogoutInitiator::run(SPRequest& request, bool isHandler) const +{ + // Defer to base class first. + pair ret = LogoutHandler::run(request, isHandler); + if (ret.first) + return ret; + + const Application& app = request.getApplication(); + string session_id = app.getServiceProvider().getSessionCache()->active(app, request); + if (!session_id.empty()) { + // Do back channel notification. + vector sessions(1, session_id); + if (!notifyBackChannel(app, request.getRequestURL(), sessions, true)) { + app.getServiceProvider().getSessionCache()->remove(app, request, &request); + return sendLogoutPage(app, request, request, true, "Partial logout failure."); + } + request.getServiceProvider().getSessionCache()->remove(app, request, &request); + } + + // Route back to return location specified, or use the local template. + const char* dest = request.getParameter("return"); + if (dest) + return make_pair(true, request.sendRedirect(dest)); + return sendLogoutPage(app, request, request, true, "Logout was successful."); +} diff --git a/shibsp/handler/impl/LogoutHandler.cpp b/shibsp/handler/impl/LogoutHandler.cpp new file mode 100644 index 0000000..3ef1cd2 --- /dev/null +++ b/shibsp/handler/impl/LogoutHandler.cpp @@ -0,0 +1,255 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LogoutHandler.cpp + * + * Base class for logout-related handlers. + */ + +#include "internal.h" +#include "exceptions.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "handler/LogoutHandler.h" +#include "util/TemplateParameters.h" + +#include +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +pair LogoutHandler::sendLogoutPage( + const Application& application, const HTTPRequest& request, HTTPResponse& response, bool local, const char* status + ) const +{ + const PropertySet* props = application.getPropertySet("Errors"); + pair prop = props ? props->getString(local ? "localLogout" : "globalLogout") : pair(false,NULL); + if (prop.first) { + response.setContentType("text/html"); + response.setResponseHeader("Expires","01-Jan-1997 12:00:00 GMT"); + response.setResponseHeader("Cache-Control","private,no-store,no-cache"); + string fname(prop.second); + ifstream infile(XMLToolingConfig::getConfig().getPathResolver()->resolve(fname, PathResolver::XMLTOOLING_CFG_FILE).c_str()); + if (!infile) + throw ConfigurationException("Unable to access $1 HTML template.", params(1,local ? "localLogout" : "globalLogout")); + TemplateParameters tp; + tp.m_request = &request; + tp.setPropertySet(props); + if (status) + tp.m_map["logoutStatus"] = status; + stringstream str; + XMLToolingConfig::getConfig().getTemplateEngine()->run(infile, str, tp); + return make_pair(true,response.sendResponse(str)); + } + prop = application.getString("homeURL"); + if (!prop.first) + prop.second = "/"; + return make_pair(true,response.sendRedirect(prop.second)); +} + +pair LogoutHandler::run(SPRequest& request, bool isHandler) const +{ + // If we're inside a chain, do nothing. + if (getParent()) + return make_pair(false,0L); + + // If this isn't a LogoutInitiator, we only "continue" a notification loop, rather than starting one. + if (!m_initiator && !request.getParameter("notifying")) + return make_pair(false,0L); + + // Try another front-channel notification. No extra parameters and the session is implicit. + return notifyFrontChannel(request.getApplication(), request, request); +} + +void LogoutHandler::receive(DDF& in, ostream& out) +{ + DDF ret(NULL); + DDFJanitor jout(ret); + if (in["notify"].integer() != 1) + throw ListenerException("Unsupported operation."); + + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + Category::getInstance(SHIBSP_LOGCAT".Logout").error("couldn't find application (%s) for logout", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for logout, deleted?"); + } + + vector sessions; + DDF s = in["sessions"]; + DDF temp = s.first(); + while (temp.isstring()) { + sessions.push_back(temp.string()); + temp = s.next(); + if (notifyBackChannel(*app, in["url"].string(), sessions, in["local"].integer()==1)) + ret.integer(1); + } + + out << ret; +} + +pair LogoutHandler::notifyFrontChannel( + const Application& application, + const HTTPRequest& request, + HTTPResponse& response, + const map* params + ) const +{ + // Index of notification point starts at 0. + unsigned int index = 0; + const char* param = request.getParameter("index"); + if (param) + index = atoi(param); + + // "return" is a backwards-compatible "eventual destination" to go back to after logout completes. + param = request.getParameter("return"); + + // Fetch the next front notification URL and bump the index for the next round trip. + string loc = application.getNotificationURL(request.getRequestURL(), true, index++); + if (loc.empty()) + return make_pair(false,0L); + + const URLEncoder* encoder = XMLToolingConfig::getConfig().getURLEncoder(); + + // Start with an "action" telling the application what this is about. + loc = loc + (strchr(loc.c_str(),'?') ? '&' : '?') + "action=logout"; + + // Now we create a second URL representing the return location back to us. + const char* start = request.getRequestURL(); + const char* end = strchr(start,'?'); + string tempstr(start, end ? end-start : strlen(start)); + ostringstream locstr(tempstr); + + // Add a signal that we're coming back from notification and the next index. + locstr << "?notifying=1&index=" << index; + + // Add return if set. + if (param) + locstr << "&return=" << encoder->encode(param); + + // We preserve anything we're instructed to directly. + if (params) { + for (map::const_iterator p = params->begin(); p!=params->end(); ++p) + locstr << '&' << p->first << '=' << encoder->encode(p->second.c_str()); + } + else { + for (vector::const_iterator q = m_preserve.begin(); q!=m_preserve.end(); ++q) { + param = request.getParameter(q->c_str()); + if (param) + locstr << '&' << *q << '=' << encoder->encode(param); + } + } + + // Add the notifier's return parameter to the destination location and redirect. + // This is NOT the same as the return parameter that might be embedded inside it ;-) + loc = loc + "&return=" + encoder->encode(locstr.str().c_str()); + return make_pair(true,response.sendRedirect(loc.c_str())); +} + +#ifndef SHIBSP_LITE +#include "util/SPConstants.h" +#include +#include +#include +using namespace soap11; +namespace { + static const XMLCh LogoutNotification[] = UNICODE_LITERAL_18(L,o,g,o,u,t,N,o,t,i,f,i,c,a,t,i,o,n); + static const XMLCh SessionID[] = UNICODE_LITERAL_9(S,e,s,s,i,o,n,I,D); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + static const XMLCh _local[] = UNICODE_LITERAL_5(l,o,c,a,l); + static const XMLCh _global[] = UNICODE_LITERAL_6(g,l,o,b,a,l); + + class SHIBSP_DLLLOCAL SOAPNotifier : public soap11::SOAPClient + { + public: + SOAPNotifier() {} + virtual ~SOAPNotifier() {} + private: + void prepareTransport(SOAPTransport& transport) { + transport.setVerifyHost(false); + } + }; +}; +#endif + +bool LogoutHandler::notifyBackChannel( + const Application& application, const char* requestURL, const vector& sessions, bool local + ) const +{ + unsigned int index = 0; + string endpoint = application.getNotificationURL(requestURL, false, index++); + if (endpoint.empty()) + return true; + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { +#ifndef SHIBSP_LITE + auto_ptr env(EnvelopeBuilder::buildEnvelope()); + Body* body = BodyBuilder::buildBody(); + env->setBody(body); + ElementProxy* msg = new AnyElementImpl(shibspconstants::SHIB2SPNOTIFY_NS, LogoutNotification); + body->getUnknownXMLObjects().push_back(msg); + msg->setAttribute(QName(NULL, _type), local ? _local : _global); + for (vector::const_iterator s = sessions.begin(); s!=sessions.end(); ++s) { + auto_ptr_XMLCh temp(s->c_str()); + ElementProxy* child = new AnyElementImpl(shibspconstants::SHIB2SPNOTIFY_NS, SessionID); + child->setTextContent(temp.get()); + msg->getUnknownXMLObjects().push_back(child); + } + + bool result = true; + SOAPNotifier soaper; + while (!endpoint.empty()) { + try { + soaper.send(*env.get(), SOAPTransport::Address(application.getId(), application.getId(), endpoint.c_str())); + delete soaper.receive(); + } + catch (exception& ex) { + Category::getInstance(SHIBSP_LOGCAT".Logout").error("error notifying application of logout event: %s", ex.what()); + result = false; + } + soaper.reset(); + endpoint = application.getNotificationURL(requestURL, false, index++); + } + return result; +#else + return false; +#endif + } + + // When not out of process, we remote the back channel work. + DDF out,in(m_address.c_str()); + DDFJanitor jin(in), jout(out); + in.addmember("notify").integer(1); + in.addmember("application_id").string(application.getId()); + in.addmember("url").string(requestURL); + if (local) + in.addmember("local").integer(1); + DDF s = in.addmember("sessions").list(); + for (vector::const_iterator i = sessions.begin(); i!=sessions.end(); ++i) { + DDF temp = DDF(NULL).string(i->c_str()); + s.add(temp); + } + out=application.getServiceProvider().getListenerService()->send(in); + return (out.integer() == 1); +} diff --git a/shibsp/handler/impl/MetadataGenerator.cpp b/shibsp/handler/impl/MetadataGenerator.cpp new file mode 100644 index 0000000..685c398 --- /dev/null +++ b/shibsp/handler/impl/MetadataGenerator.cpp @@ -0,0 +1,385 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * MetadataGenerator.cpp + * + * Handler for generating "approximate" metadata based on SP configuration. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" + +#include +#include + +using namespace shibsp; +#ifndef SHIBSP_LITE +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmlsignature; +#endif +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + }; + + static SHIBSP_DLLLOCAL Blocker g_Blocker; + + class SHIBSP_API MetadataGenerator : public AbstractHandler, public RemotedHandler + { + public: + MetadataGenerator(const DOMElement* e, const char* appId); + virtual ~MetadataGenerator() {} + + pair run(SPRequest& request, bool isHandler=true) const; + void receive(DDF& in, ostream& out); + + private: + pair processMessage( + const Application& application, + const char* handlerURL, + const char* entityID, + HTTPResponse& httpResponse + ) const; + + set m_acl; +#ifndef SHIBSP_LITE + short m_http,m_https; + vector m_bases; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL MetadataGeneratorFactory(const pair& p) + { + return new MetadataGenerator(p.first, p.second); + } + +}; + +MetadataGenerator::MetadataGenerator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".MetadataGenerator"), &g_Blocker) +#ifndef SHIBSP_LITE + ,m_http(0), m_https(0) +#endif +{ + string address(appId); + address += getString("Location").second; + setAddress(address.c_str()); + if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) { + pair acl = getString("acl"); + if (acl.first) { + string aclbuf=acl.second; + int j = 0; + for (unsigned int i=0; i < aclbuf.length(); i++) { + if (aclbuf.at(i)==' ') { + m_acl.insert(aclbuf.substr(j, i-j)); + j = i+1; + } + } + m_acl.insert(aclbuf.substr(j, aclbuf.length()-j)); + } + } + +#ifndef SHIBSP_LITE + static XMLCh EndpointBase[] = UNICODE_LITERAL_12(E,n,d,p,o,i,n,t,B,a,s,e); + + pair flag = getBool("http"); + if (flag.first) + m_http = flag.second ? 1 : -1; + flag = getBool("https"); + if (flag.first) + m_https = flag.second ? 1 : -1; + + e = XMLHelper::getFirstChildElement(e, EndpointBase); + while (e) { + if (e->hasChildNodes()) { + auto_ptr_char base(e->getFirstChild()->getNodeValue()); + if (base.get() && *base.get()) + m_bases.push_back(base.get()); + } + e = XMLHelper::getNextSiblingElement(e, EndpointBase); + } +#endif +} + +pair MetadataGenerator::run(SPRequest& request, bool isHandler) const +{ + SPConfig& conf = SPConfig::getConfig(); + if (conf.isEnabled(SPConfig::InProcess)) { + if (!m_acl.empty() && m_acl.count(request.getRemoteAddr()) == 0) { + m_log.error("request for metadata blocked from invalid address (%s)", request.getRemoteAddr().c_str()); + istringstream msg("Metadata Request Blocked"); + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_UNAUTHORIZED)); + } + } + + try { + if (conf.isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively and directly process the message. + return processMessage(request.getApplication(), request.getHandlerURL(), request.getParameter("entityID"), request); + } + else { + // When not out of process, we remote all the message processing. + DDF out,in = DDF(m_address.c_str()); + in.addmember("application_id").string(request.getApplication().getId()); + in.addmember("handler_url").string(request.getHandlerURL()); + if (request.getParameter("entityID")) + in.addmember("entity_id").string(request.getParameter("entityID")); + DDFJanitor jin(in), jout(out); + + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } + } + catch (exception& ex) { + m_log.error("error while processing request: %s", ex.what()); + istringstream msg("Metadata Request Failed"); + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR)); + } +} + +void MetadataGenerator::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const char* hurl=in["handler_url"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for metadata request", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for metadata request, deleted?"); + } + else if (!hurl) { + throw ConfigurationException("Missing handler_url parameter in remoted method call."); + } + + // Wrap a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + // Since we're remoted, the result should either be a throw, a false/0 return, + // which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + processMessage(*app, hurl, in["entity_id"].string(), *resp.get()); + out << ret; +} + +pair MetadataGenerator::processMessage( + const Application& application, const char* handlerURL, const char* entityID, HTTPResponse& httpResponse + ) const +{ +#ifndef SHIBSP_LITE + m_log.debug("processing metadata request"); + + const PropertySet* relyingParty=NULL; + if (entityID) { + MetadataProvider* m=application.getMetadataProvider(); + Locker locker(m); + MetadataProvider::Criteria mc(entityID); + relyingParty = application.getRelyingParty(m->getEntityDescriptor(mc).first); + } + else { + relyingParty = application.getRelyingParty(NULL); + } + + EntityDescriptor* entity; + pair prop = getString("template"); + if (prop.first) { + // Load a template to use for our metadata. + LocalFileInputSource src(getXMLString("template").second); + Wrapper4InputSource dsrc(&src,false); + DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(dsrc); + XercesJanitor docjan(doc); + auto_ptr xmlobj(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true)); + docjan.release(); + entity = dynamic_cast(xmlobj.get()); + if (!entity) + throw ConfigurationException("Template file ($1) did not contain an EntityDescriptor", params(1, prop.second)); + xmlobj.release(); + } + else { + entity = EntityDescriptorBuilder::buildEntityDescriptor(); + } + + auto_ptr wrapper(entity); + pair cache = getUnsignedInt("cacheDuration"); + if (cache.first) + entity->setValidUntil(time(NULL) + cache.second); + entity->setEntityID(relyingParty->getXMLString("entityID").second); + + SPSSODescriptor* role; + if (entity->getSPSSODescriptors().empty()) { + role = SPSSODescriptorBuilder::buildSPSSODescriptor(); + entity->getSPSSODescriptors().push_back(role); + } + else { + role = entity->getSPSSODescriptors().front(); + } + + // Policy flags. + prop = relyingParty->getString("signing"); + if (prop.first && (!strcmp(prop.second,"true") || !strcmp(prop.second,"front"))) + role->AuthnRequestsSigned(true); + pair flagprop = relyingParty->getBool("requireSignedAssertions"); + if (flagprop.first && flagprop.second) + role->WantAssertionsSigned(true); + + // Ask each handler to generate itself. + vector handlers; + application.getHandlers(handlers); + for (vector::const_iterator h = handlers.begin(); h != handlers.end(); ++h) { + if (m_bases.empty()) { + if (strncmp(handlerURL, "https", 5) == 0) { + if (m_https >= 0) + (*h)->generateMetadata(*role, handlerURL); + if (m_http == 1) { + string temp(handlerURL); + temp.erase(4, 1); + (*h)->generateMetadata(*role, temp.c_str()); + } + } + else { + if (m_http >= 0) + (*h)->generateMetadata(*role, handlerURL); + if (m_https == 1) { + string temp(handlerURL); + temp.insert(temp.begin() + 4, 's'); + (*h)->generateMetadata(*role, temp.c_str()); + } + } + } + else { + for (vector::const_iterator b = m_bases.begin(); b != m_bases.end(); ++b) + (*h)->generateMetadata(*role, b->c_str()); + } + } + + CredentialResolver* credResolver=application.getCredentialResolver(); + if (credResolver) { + Locker credLocker(credResolver); + CredentialCriteria cc; + prop = relyingParty->getString("keyName"); + if (prop.first) + cc.getKeyNames().insert(prop.second); + cc.setUsage(Credential::SIGNING_CREDENTIAL); + vector creds; + credResolver->resolve(creds,&cc); + for (vector::const_iterator c = creds.begin(); c != creds.end(); ++c) { + KeyInfo* kinfo = (*c)->getKeyInfo(); + if (kinfo) { + KeyDescriptor* kd = KeyDescriptorBuilder::buildKeyDescriptor(); + kd->setUse(KeyDescriptor::KEYTYPE_SIGNING); + kd->setKeyInfo(kinfo); + role->getKeyDescriptors().push_back(kd); + } + } + + cc.setUsage(Credential::ENCRYPTION_CREDENTIAL); + creds.clear(); + credResolver->resolve(creds,&cc); + for (vector::const_iterator c = creds.begin(); c != creds.end(); ++c) { + KeyInfo* kinfo = (*c)->getKeyInfo(); + if (kinfo) { + KeyDescriptor* kd = KeyDescriptorBuilder::buildKeyDescriptor(); + kd->setUse(KeyDescriptor::KEYTYPE_ENCRYPTION); + kd->setKeyInfo(kinfo); + role->getKeyDescriptors().push_back(kd); + } + } + } + + // Stream for response. + stringstream s; + + // Self-sign it? + pair flag = getBool("signing"); + if (flag.first && flag.second) { + if (credResolver) { + Locker credLocker(credResolver); + // Fill in criteria to use. + CredentialCriteria cc; + cc.setUsage(Credential::SIGNING_CREDENTIAL); + prop = getString("keyName"); + if (prop.first) + cc.getKeyNames().insert(prop.second); + pair sigalg = getXMLString("signingAlg"); + pair digalg = getXMLString("digestAlg"); + if (sigalg.first) + cc.setXMLAlgorithm(sigalg.second); + const Credential* cred = credResolver->resolve(&cc); + if (!cred) + throw XMLSecurityException("Unable to obtain signing credential to use."); + + // Pretty-print it first and then read it back in. + stringstream pretty; + XMLHelper::serialize(entity->marshall(), pretty, true); + DOMDocument* prettydoc = XMLToolingConfig::getConfig().getParser().parse(pretty); + auto_ptr prettyentity(XMLObjectBuilder::buildOneFromElement(prettydoc->getDocumentElement(), true)); + + Signature* sig = SignatureBuilder::buildSignature(); + dynamic_cast(prettyentity.get())->setSignature(sig); + if (sigalg.first) + sig->setSignatureAlgorithm(sigalg.second); + if (digalg.first) { + opensaml::ContentReference* cr = dynamic_cast(sig->getContentReference()); + if (cr) + cr->setDigestAlgorithm(digalg.second); + } + + // Sign while marshalling. + vector sigs(1,sig); + prettyentity->marshall(prettydoc,&sigs,cred); + s << *prettyentity; + } + else { + throw FatalProfileException("Can't self-sign metadata, no credential resolver found."); + } + } + else { + // Pretty-print it directly to client. + XMLHelper::serialize(entity->marshall(), s, true); + } + + prop = getString("mimeType"); + httpResponse.setContentType(prop.first ? prop.second : "application/samlmetadata+xml"); + return make_pair(true, httpResponse.sendResponse(s)); +#else + return make_pair(false,0L); +#endif +} diff --git a/shibsp/handler/impl/RemotedHandler.cpp b/shibsp/handler/impl/RemotedHandler.cpp new file mode 100644 index 0000000..b8580e2 --- /dev/null +++ b/shibsp/handler/impl/RemotedHandler.cpp @@ -0,0 +1,332 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * RemotedHandler.cpp + * + * Base class for handlers that need SP request/response layer to be remoted. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "handler/RemotedHandler.h" + +#include +#include + +#ifndef SHIBSP_LITE +# include "util/CGIParser.h" +# include +# include +# include +# include +#endif + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +#ifndef SHIBSP_LITE +namespace shibsp { + class SHIBSP_DLLLOCAL RemotedRequest : public virtual HTTPRequest + { + DDF& m_input; + mutable CGIParser* m_parser; + mutable vector m_certs; + public: + RemotedRequest(DDF& input) : m_input(input), m_parser(NULL) {} + virtual ~RemotedRequest() { + for_each(m_certs.begin(), m_certs.end(), xmltooling::cleanup()); + delete m_parser; + } + + // GenericRequest + const char* getScheme() const { + return m_input["scheme"].string(); + } + const char* getHostname() const { + return m_input["hostname"].string(); + } + int getPort() const { + return m_input["port"].integer(); + } + std::string getContentType() const { + DDF s = m_input["content_type"]; + return s.string() ? s.string() : ""; + } + long getContentLength() const { + return m_input["content_length"].integer(); + } + const char* getRequestBody() const { + return m_input["body"].string(); + } + + const char* getParameter(const char* name) const; + std::vector::size_type getParameters(const char* name, std::vector& values) const; + + std::string getRemoteUser() const { + DDF s = m_input["remote_user"]; + return s.string() ? s.string() : ""; + } + std::string getRemoteAddr() const { + DDF s = m_input["client_addr"]; + return s.string() ? s.string() : ""; + } + + const std::vector& getClientCertificates() const; + + // HTTPRequest + const char* getMethod() const { + return m_input["method"].string(); + } + const char* getRequestURI() const { + return m_input["uri"].string(); + } + const char* getRequestURL() const { + return m_input["url"].string(); + } + const char* getQueryString() const { + return m_input["query"].string(); + } + std::string getHeader(const char* name) const { + DDF s = m_input["headers"][name]; + return s.string() ? s.string() : ""; + } + }; + + class SHIBSP_DLLLOCAL RemotedResponse : public virtual HTTPResponse + { + DDF& m_output; + public: + RemotedResponse(DDF& output) : m_output(output) {} + virtual ~RemotedResponse() {} + + // GenericResponse + long sendResponse(std::istream& inputStream, long status); + + // HTTPResponse + void setResponseHeader(const char* name, const char* value); + long sendRedirect(const char* url); + }; +} + +const char* RemotedRequest::getParameter(const char* name) const +{ + if (!m_parser) + m_parser=new CGIParser(*this); + + pair bounds=m_parser->getParameters(name); + return (bounds.first==bounds.second) ? NULL : bounds.first->second; +} + +std::vector::size_type RemotedRequest::getParameters(const char* name, std::vector& values) const +{ + if (!m_parser) + m_parser=new CGIParser(*this); + + pair bounds=m_parser->getParameters(name); + while (bounds.first!=bounds.second) { + values.push_back(bounds.first->second); + ++bounds.first; + } + return values.size(); +} + +const std::vector& RemotedRequest::getClientCertificates() const +{ + if (m_certs.empty()) { + DDF certs = m_input["certificates"]; + DDF cert = certs.first(); + while (cert.string()) { + try { + auto_ptr x509(XSECPlatformUtils::g_cryptoProvider->X509()); + if (strstr(cert.string(), "BEGIN")) + x509->loadX509PEM(cert.string(), cert.strlen()); + else + x509->loadX509Base64Bin(cert.string(), cert.strlen()); + m_certs.push_back(x509.release()); + } + catch(XSECException& e) { + auto_ptr_char temp(e.getMsg()); + Category::getInstance(SHIBSP_LOGCAT".SPRequest").error("XML-Security exception loading client certificate: %s", temp.get()); + } + catch(XSECCryptoException& e) { + Category::getInstance(SHIBSP_LOGCAT".SPRequest").error("XML-Security exception loading client certificate: %s", e.getMsg()); + } + cert = certs.next(); + } + } + return m_certs; +} + +long RemotedResponse::sendResponse(std::istream& in, long status) +{ + string msg; + char buf[1024]; + while (in) { + in.read(buf,1024); + msg.append(buf,in.gcount()); + } + if (!m_output.isstruct()) + m_output.structure(); + m_output.addmember("response.data").string(msg.c_str()); + m_output.addmember("response.status").integer(status); + return status; +} + +void RemotedResponse::setResponseHeader(const char* name, const char* value) +{ + if (!m_output.isstruct()) + m_output.structure(); + DDF hdrs = m_output["headers"]; + if (hdrs.isnull()) + hdrs = m_output.addmember("headers").list(); + DDF h = DDF(name).string(value); + hdrs.add(h); +} + +long RemotedResponse::sendRedirect(const char* url) +{ + if (!m_output.isstruct()) + m_output.structure(); + m_output.addmember("redirect").string(url); + return HTTPResponse::XMLTOOLING_HTTP_STATUS_MOVED; +} + +#endif + +void RemotedHandler::setAddress(const char* address) +{ + if (!m_address.empty()) + throw ConfigurationException("Cannot register a remoting address twice for the same Handler."); + m_address = address; + SPConfig& conf = SPConfig::getConfig(); + if (!conf.isEnabled(SPConfig::InProcess)) { + ListenerService* listener = conf.getServiceProvider()->getListenerService(false); + if (listener) + listener->regListener(m_address.c_str(),this); + else + Category::getInstance(SHIBSP_LOGCAT".Handler").info("no ListenerService available, handler remoting disabled"); + } +} + +RemotedHandler::~RemotedHandler() +{ + SPConfig& conf = SPConfig::getConfig(); + ListenerService* listener=conf.getServiceProvider()->getListenerService(false); + if (listener && conf.isEnabled(SPConfig::OutOfProcess) && !conf.isEnabled(SPConfig::InProcess)) + listener->unregListener(m_address.c_str(),this); +} + +DDF RemotedHandler::wrap(const SPRequest& request, const vector* headers, bool certs) const +{ + DDF in = DDF(m_address.c_str()).structure(); + in.addmember("application_id").string(request.getApplication().getId()); + in.addmember("scheme").string(request.getScheme()); + in.addmember("hostname").string(request.getHostname()); + in.addmember("port").integer(request.getPort()); + in.addmember("content_type").string(request.getContentType().c_str()); + in.addmember("content_length").integer(request.getContentLength()); + in.addmember("body").string(request.getRequestBody()); + in.addmember("remote_user").string(request.getRemoteUser().c_str()); + in.addmember("client_addr").string(request.getRemoteAddr().c_str()); + in.addmember("method").string(request.getMethod()); + in.addmember("uri").string(request.getRequestURI()); + in.addmember("url").string(request.getRequestURL()); + in.addmember("query").string(request.getQueryString()); + + if (headers) { + string hdr; + DDF hin = in.addmember("headers").structure(); + for (vector::const_iterator h = headers->begin(); h!=headers->end(); ++h) { + hdr = request.getHeader(h->c_str()); + if (!hdr.empty()) + hin.addmember(h->c_str()).string(hdr.c_str()); + } + } + + if (certs) { +#ifndef SHIBSP_LITE + const vector& xvec = request.getClientCertificates(); + if (!xvec.empty()) { + DDF clist = in.addmember("certificates").list(); + for (vector::const_iterator x = xvec.begin(); x!=xvec.end(); ++x) { + DDF x509 = DDF(NULL).string((*x)->getDEREncodingSB().rawCharBuffer()); + clist.add(x509); + } + } +#else + const vector& xvec = request.getClientCertificates(); + if (!xvec.empty()) { + DDF clist = in.addmember("certificates").list(); + for (vector::const_iterator x = xvec.begin(); x!=xvec.end(); ++x) { + DDF x509 = DDF(NULL).string(x->c_str()); + clist.add(x509); + } + } +#endif + } + + return in; +} + +pair RemotedHandler::unwrap(SPRequest& request, DDF& out) const +{ + DDF h = out["headers"]; + DDF hdr = h.first(); + while (hdr.isstring()) { +#ifdef HAVE_STRCASECMP + if (!strcasecmp(hdr.name(), "Content-Type")) +#else + if (!stricmp(hdr.name(), "Content-Type")) +#endif + request.setContentType(hdr.string()); + else + request.setResponseHeader(hdr.name(), hdr.string()); + hdr = h.next(); + } + h = out["redirect"]; + if (h.isstring()) + return make_pair(true, request.sendRedirect(h.string())); + h = out["response"]; + if (h.isstruct()) { + istringstream s(h["data"].string()); + return make_pair(true, request.sendResponse(s, h["status"].integer())); + } + return make_pair(false,0L); +} + +HTTPRequest* RemotedHandler::getRequest(DDF& in) const +{ +#ifndef SHIBSP_LITE + return new RemotedRequest(in); +#else + throw ConfigurationException("Cannot process message using lite version of shibsp library."); +#endif +} + +HTTPResponse* RemotedHandler::getResponse(DDF& out) const +{ +#ifndef SHIBSP_LITE + return new RemotedResponse(out); +#else + throw ConfigurationException("Cannot process message using lite version of shibsp library."); +#endif +} diff --git a/shibsp/handler/impl/SAML1Consumer.cpp b/shibsp/handler/impl/SAML1Consumer.cpp new file mode 100644 index 0000000..d1c46b8 --- /dev/null +++ b/shibsp/handler/impl/SAML1Consumer.cpp @@ -0,0 +1,290 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAML1Consumer.cpp + * + * SAML 1.x assertion consumer service + */ + +#include "internal.h" +#include "handler/AssertionConsumerService.h" + +#ifndef SHIBSP_LITE +# include "exceptions.h" +# include "Application.h" +# include "ServiceProvider.h" +# include "SessionCache.h" +# include "attribute/resolver/ResolutionContext.h" +# include +# include +# include +# include +using namespace opensaml::saml1; +using namespace opensaml::saml1p; +using namespace opensaml; +using saml2::NameID; +using saml2::NameIDBuilder; +using saml2md::EntityDescriptor; +using saml2md::SPSSODescriptor; +using saml2md::MetadataException; +#else +# include "lite/SAMLConstants.h" +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL SAML1Consumer : public AssertionConsumerService + { + public: + SAML1Consumer(const DOMElement* e, const char* appId) + : AssertionConsumerService(e, appId, Category::getInstance(SHIBSP_LOGCAT".SSO.SAML1")) { +#ifndef SHIBSP_LITE + m_post = XMLString::equals(getString("Binding").second, samlconstants::SAML1_PROFILE_BROWSER_POST); +#endif + } + virtual ~SAML1Consumer() {} + +#ifndef SHIBSP_LITE + void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + AssertionConsumerService::generateMetadata(role, handlerURL); + role.addSupport(samlconstants::SAML11_PROTOCOL_ENUM); + role.addSupport(samlconstants::SAML10_PROTOCOL_ENUM); + } + + private: + void implementProtocol( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + SecurityPolicy& policy, + const PropertySet* settings, + const XMLObject& xmlObject + ) const; + bool m_post; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL SAML1ConsumerFactory(const pair& p) + { + return new SAML1Consumer(p.first, p.second); + } + +}; + +#ifndef SHIBSP_LITE + +void SAML1Consumer::implementProtocol( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + SecurityPolicy& policy, + const PropertySet* settings, + const XMLObject& xmlObject + ) const +{ + // Implementation of SAML 1.x SSO profile(s). + m_log.debug("processing message against SAML 1.x SSO profile"); + + // Check for errors...this will throw if it's not a successful message. + checkError(&xmlObject); + + // With the binding aspects now moved out to the MessageDecoder, + // the focus here is on the assertion content. For SAML 1.x POST, + // all the security comes from the protocol layer, and signing + // the assertion isn't sufficient. So we can check the policy + // object now and bail if it's not a secured message. + if (m_post && !policy.isAuthenticated()) { + if (policy.getIssuer() && !policy.getIssuerMetadata()) + throw MetadataException("Security of SAML 1.x SSO POST response not established."); + throw SecurityPolicyException("Security of SAML 1.x SSO POST response not established."); + } + + // Remember whether we already established trust. + bool alreadySecured = policy.isAuthenticated(); + + const Response* response = dynamic_cast(&xmlObject); + if (!response) + throw FatalProfileException("Incoming message was not a samlp:Response."); + + const vector& assertions = response->getAssertions(); + if (assertions.empty()) + throw FatalProfileException("Incoming message contained no SAML assertions."); + + pair minor = response->getMinorVersion(); + + // Maintain list of "legit" tokens to feed to SP subsystems. + const AuthenticationStatement* ssoStatement=NULL; + vector tokens; + + // Also track "bad" tokens that we'll cache but not use. + // This is necessary because there may be valid tokens not aimed at us. + vector badtokens; + + // With this flag on, we ignore any unsigned assertions. + const EntityDescriptor* entity = policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : NULL; + pair flag = application.getRelyingParty(entity)->getBool("requireSignedAssertions"); + + // authnskew allows rejection of SSO if AuthnInstant is too old. + const PropertySet* sessionProps = application.getPropertySet("Sessions"); + pair authnskew = sessionProps ? sessionProps->getUnsignedInt("maxTimeSinceAuthn") : pair(false,0); + + // Saves off error messages potentially helpful for users. + string contextualError; + + // Profile validator. + time_t now = time(NULL); + BrowserSSOProfileValidator ssoValidator(application.getRelyingParty(entity)->getXMLString("entityID").second, application.getAudiences(), now); + + for (vector::const_iterator a = assertions.begin(); a!=assertions.end(); ++a) { + try { + // Skip unsigned assertion? + if (!(*a)->getSignature() && flag.first && flag.second) + throw SecurityPolicyException("The incoming assertion was unsigned, violating local security policy."); + + // We clear the security flag, so we can tell whether the token was secured on its own. + policy.setAuthenticated(false); + policy.reset(true); + + // Extract message bits and re-verify Issuer information. + extractMessageDetails( + *(*a), (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM, policy + ); + + // Run the policy over the assertion. Handles replay, freshness, and + // signature verification, assuming the relevant rules are configured. + policy.evaluate(*(*a)); + + // If no security is in place now, we kick it. + if (!alreadySecured && !policy.isAuthenticated()) + throw SecurityPolicyException("Unable to establish security of incoming assertion."); + + // Now do profile and core semantic validation to ensure we can use it for SSO. + ssoValidator.validateAssertion(*(*a)); + + // Track it as a valid token. + tokens.push_back(*a); + + // Save off the first valid SSO statement. + const vector& statements = const_cast(*a)->getAuthenticationStatements(); + for (vector::const_iterator s = statements.begin(); s!=statements.end(); ++s) { + if (authnskew.first && authnskew.second && + (*s)->getAuthenticationInstant() && (now - (*s)->getAuthenticationInstantEpoch() > authnskew.second)) + contextualError = "The gap between now and the time you logged into your identity provider exceeds the limit."; + else if (!ssoStatement) { + ssoStatement = *s; + break; + } + } + } + catch (exception& ex) { + m_log.warn("detected a problem with assertion: %s", ex.what()); + if (!ssoStatement) + contextualError = ex.what(); + badtokens.push_back(*a); + } + } + + if (!ssoStatement) { + if (contextualError.empty()) + throw FatalProfileException("A valid authentication statement was not found in the incoming message."); + throw FatalProfileException(contextualError.c_str()); + } + + // Address checking. + SubjectLocality* locality = ssoStatement->getSubjectLocality(); + if (locality && locality->getIPAddress()) { + auto_ptr_char ip(locality->getIPAddress()); + checkAddress(application, httpRequest, ip.get()); + } + + m_log.debug("SSO profile processing completed successfully"); + + NameIdentifier* n = ssoStatement->getSubject()->getNameIdentifier(); + + // Now we have to extract the authentication details for attribute and session setup. + + // Session expiration for SAML 1.x is purely SP-driven, and the method is mapped to a ctx class. + pair lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair(true,28800); + if (!lifetime.first || lifetime.second == 0) + lifetime.second = 28800; + + // We've successfully "accepted" at least one SSO token, along with any additional valid tokens. + // To complete processing, we need to extract and resolve attributes and then create the session. + + // Normalize the SAML 1.x NameIdentifier... + auto_ptr nameid(n ? NameIDBuilder::buildNameID() : NULL); + if (n) { + nameid->setName(n->getName()); + nameid->setFormat(n->getFormat()); + nameid->setNameQualifier(n->getNameQualifier()); + } + + // The context will handle deleting attributes and new tokens. + auto_ptr ctx( + resolveAttributes( + application, + policy.getIssuerMetadata(), + (!response->getMinorVersion().first || response->getMinorVersion().second==1) ? + samlconstants::SAML11_PROTOCOL_ENUM : samlconstants::SAML10_PROTOCOL_ENUM, + n, + nameid.get(), + ssoStatement->getAuthenticationMethod(), + NULL, + &tokens + ) + ); + + if (ctx.get()) { + // Copy over any new tokens, but leave them in the context for cleanup. + tokens.insert(tokens.end(), ctx->getResolvedAssertions().begin(), ctx->getResolvedAssertions().end()); + } + + // Now merge in bad tokens for caching. + tokens.insert(tokens.end(), badtokens.begin(), badtokens.end()); + + application.getServiceProvider().getSessionCache()->insert( + application, + httpRequest, + httpResponse, + now + lifetime.second, + entity, + (!response->getMinorVersion().first || response->getMinorVersion().second==1) ? + samlconstants::SAML11_PROTOCOL_ENUM : samlconstants::SAML10_PROTOCOL_ENUM, + nameid.get(), + ssoStatement->getAuthenticationInstant() ? ssoStatement->getAuthenticationInstant()->getRawData() : NULL, + NULL, + ssoStatement->getAuthenticationMethod(), + NULL, + &tokens, + ctx.get() ? &ctx->getResolvedAttributes() : NULL + ); +} + +#endif diff --git a/shibsp/handler/impl/SAML2ArtifactResolution.cpp b/shibsp/handler/impl/SAML2ArtifactResolution.cpp new file mode 100644 index 0000000..ef85778 --- /dev/null +++ b/shibsp/handler/impl/SAML2ArtifactResolution.cpp @@ -0,0 +1,345 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAML2ArtifactResolution.cpp + * + * Handler for resolving SAML 2.0 artifacts. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" +#include "util/SPConstants.h" + +#ifndef SHIBSP_LITE +# include "security/SecurityPolicy.h" +# include +# include +# include +# include +# include +# include +# include +# include +using namespace opensaml::saml2md; +using namespace opensaml::saml2p; +using namespace opensaml::saml2; +using namespace samlconstants; +#endif + +#include + +using namespace shibspconstants; +using namespace shibsp; +using namespace opensaml; +using namespace soap11; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_API SAML2ArtifactResolution : public AbstractHandler, public RemotedHandler + { + public: + SAML2ArtifactResolution(const DOMElement* e, const char* appId); + virtual ~SAML2ArtifactResolution(); + + pair run(SPRequest& request, bool isHandler=true) const; + void receive(DDF& in, ostream& out); + +#ifndef SHIBSP_LITE + const char* getType() const { + return "ArtifactResolutionService"; + } +#endif + + private: + pair processMessage(const Application& application, HTTPRequest& httpRequest, HTTPResponse& httpResponse) const; +#ifndef SHIBSP_LITE + pair samlError( + const Application& app, + const ArtifactResolve& request, + HTTPResponse& httpResponse, + const EntityDescriptor* recipient, + const XMLCh* code, + const XMLCh* subcode=NULL, + const char* msg=NULL + ) const; + + MessageEncoder* m_encoder; + MessageDecoder* m_decoder; + QName m_role; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL SAML2ArtifactResolutionFactory(const pair& p) + { + return new SAML2ArtifactResolution(p.first, p.second); + } + +}; + +SAML2ArtifactResolution::SAML2ArtifactResolution(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".ArtifactResolution.SAML2")) +#ifndef SHIBSP_LITE + ,m_encoder(NULL), m_decoder(NULL), m_role(samlconstants::SAML20MD_NS, opensaml::saml2md::IDPSSODescriptor::LOCAL_NAME) +#endif +{ +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + try { + m_encoder = SAMLConfig::getConfig().MessageEncoderManager.newPlugin( + getString("Binding").second,pair(e,NULL) + ); + m_decoder = SAMLConfig::getConfig().MessageDecoderManager.newPlugin( + getString("Binding").second,pair(e,NULL) + ); + } + catch (exception& ex) { + m_log.error("error building MessageEncoder/Decoder pair for binding (%s)", getString("Binding").second); + delete m_encoder; + delete m_decoder; + throw; + } + } +#endif + string address(appId); + address += getString("Location").second; + address += "::run::SAML2Artifact"; + setAddress(address.c_str()); +} + +SAML2ArtifactResolution::~SAML2ArtifactResolution() +{ +#ifndef SHIBSP_LITE + delete m_encoder; + delete m_decoder; +#endif +} + +pair SAML2ArtifactResolution::run(SPRequest& request, bool isHandler) const +{ + string relayState; + SPConfig& conf = SPConfig::getConfig(); + + try { + if (conf.isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively and directly process the message. + return processMessage(request.getApplication(), request, request); + } + else { + // When not out of process, we remote all the message processing. + DDF out,in = wrap(request, NULL, true); + DDFJanitor jin(in), jout(out); + + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } + } + catch (exception& ex) { + m_log.error("error while processing request: %s", ex.what()); + + // Build a SOAP fault around the error. + auto_ptr fault(FaultBuilder::buildFault()); + Faultcode* code = FaultcodeBuilder::buildFaultcode(); + fault->setFaultcode(code); + code->setCode(&Faultcode::SERVER); + Faultstring* fs = FaultstringBuilder::buildFaultstring(); + fault->setFaultstring(fs); + pair flag = getBool("detailedErrors", m_configNS.get()); + auto_ptr_XMLCh msg((flag.first && flag.second) ? ex.what() : "Error processing request."); + fs->setString(msg.get()); +#ifndef SHIBSP_LITE + // Use MessageEncoder to send back the fault. + long ret = m_encoder->encode(request, fault.get(), NULL); + fault.release(); + return make_pair(true, ret); +#else + // Brute force the fault to avoid library dependency. + auto_ptr env(EnvelopeBuilder::buildEnvelope()); + Body* body = BodyBuilder::buildBody(); + env->setBody(body); + body->getUnknownXMLObjects().push_back(fault.release()); + string xmlbuf; + XMLHelper::serialize(env->marshall(), xmlbuf); + istringstream s(xmlbuf); + request.setContentType("text/xml"); + return make_pair(true, request.sendError(s)); +#endif + } +} + +void SAML2ArtifactResolution::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for artifact resolution", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for artifact resolution, deleted?"); + } + + // Unpack the request. + auto_ptr req(getRequest(in)); + //m_log.debug("found %d client certificates", req->getClientCertificates().size()); + + // Wrap a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + try { + // Since we're remoted, the result should either be a throw, a false/0 return, + // which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + processMessage(*app, *req.get(), *resp.get()); + out << ret; + } + catch (exception& ex) { +#ifndef SHIBSP_LITE + m_log.error("error while processing request: %s", ex.what()); + + // Use MessageEncoder to send back a SOAP fault. + auto_ptr fault(FaultBuilder::buildFault()); + Faultcode* code = FaultcodeBuilder::buildFaultcode(); + fault->setFaultcode(code); + code->setCode(&Faultcode::SERVER); + Faultstring* fs = FaultstringBuilder::buildFaultstring(); + fault->setFaultstring(fs); + pair flag = getBool("detailedErrors", m_configNS.get()); + auto_ptr_XMLCh msg((flag.first && flag.second) ? ex.what() : "Error processing request."); + fs->setString(msg.get()); + m_encoder->encode(*resp.get(), fault.get(), NULL); + fault.release(); + out << ret; +#else + throw; // should never happen anyway +#endif + } +} + +pair SAML2ArtifactResolution::processMessage(const Application& application, HTTPRequest& httpRequest, HTTPResponse& httpResponse) const +{ +#ifndef SHIBSP_LITE + m_log.debug("processing SAML 2.0 ArtifactResolve request"); + + ArtifactMap* artmap = SAMLConfig::getConfig().getArtifactMap(); + if (!artmap) + throw ConfigurationException("No ArtifactMap instance installed."); + + // Locate policy key. + pair policyId = getString("policyId", m_configNS.get()); // namespace-qualified if inside handler element + if (!policyId.first) + policyId = application.getString("policyId"); // unqualified in Application(s) element + + // Access policy properties. + const PropertySet* settings = application.getServiceProvider().getPolicySettings(policyId.second); + pair validate = settings->getBool("validate"); + + // Lock metadata for use by policy. + Locker metadataLocker(application.getMetadataProvider()); + + // Create the policy. + shibsp::SecurityPolicy policy(application, &m_role, validate.first && validate.second); + + // Decode the message and verify that it's a secured ArtifactResolve request. + string relayState; + auto_ptr msg(m_decoder->decode(relayState, httpRequest, policy)); + if (!msg.get()) + throw BindingException("Failed to decode a SAML request."); + const ArtifactResolve* req = dynamic_cast(msg.get()); + if (!req) + throw FatalProfileException("Decoded message was not a samlp::ArtifactResolve request."); + + const EntityDescriptor* entity = policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : NULL; + + try { + auto_ptr_char artifact(req->getArtifact() ? req->getArtifact()->getArtifact() : NULL); + if (!artifact.get() || !*artifact.get()) + return samlError(application, *req, httpResponse, entity, StatusCode::REQUESTER, NULL, "Request did not contain an artifact to resolve."); + auto_ptr_char issuer(policy.getIssuer() ? policy.getIssuer()->getName() : NULL); + + m_log.info("resolving artifact (%s) for (%s)", artifact.get(), issuer.get() ? issuer.get() : "unknown"); + + // Parse the artifact and retrieve the object. + auto_ptr artobj(SAMLArtifact::parse(artifact.get())); + auto_ptr payload(artmap->retrieveContent(artobj.get(), issuer.get())); + + if (!policy.isAuthenticated()) { + m_log.error("request for artifact was unauthenticated, purging the artifact mapping"); + return samlError(application, *req, httpResponse, entity, StatusCode::REQUESTER, StatusCode::AUTHN_FAILED, "Unable to authenticate request."); + } + + m_log.debug("artifact resolved, preparing response"); + + // Wrap it in a response. + auto_ptr resp(ArtifactResponseBuilder::buildArtifactResponse()); + resp->setInResponseTo(req->getID()); + Issuer* me = IssuerBuilder::buildIssuer(); + me->setName(application.getRelyingParty(entity)->getXMLString("entityID").second); + resp->setPayload(payload.release()); + + long ret = sendMessage( + *m_encoder, resp.get(), relayState.c_str(), NULL, policy.getIssuerMetadata(), application, httpResponse, "signResponses" + ); + resp.release(); // freed by encoder + return make_pair(true,ret); + } + catch (exception& ex) { + // Trap localized errors in a SAML Response. + m_log.error("error processing artifact request, returning SAML error: %s", ex.what()); + return samlError(application, *req, httpResponse, entity, StatusCode::RESPONDER, NULL, ex.what()); + } +#else + return make_pair(false,0L); +#endif +} + +#ifndef SHIBSP_LITE +pair SAML2ArtifactResolution::samlError( + const Application& app, + const ArtifactResolve& request, + HTTPResponse& httpResponse, + const EntityDescriptor* recipient, + const XMLCh* code, + const XMLCh* subcode, + const char* msg + ) const +{ + auto_ptr resp(ArtifactResponseBuilder::buildArtifactResponse()); + resp->setInResponseTo(request.getID()); + Issuer* me = IssuerBuilder::buildIssuer(); + me->setName(app.getRelyingParty(recipient)->getXMLString("entityID").second); + fillStatus(*resp.get(), code, subcode, msg); + long ret = m_encoder->encode(httpResponse, resp.get(), NULL); + resp.release(); // freed by encoder + return make_pair(true,ret); +} +#endif diff --git a/shibsp/handler/impl/SAML2Consumer.cpp b/shibsp/handler/impl/SAML2Consumer.cpp new file mode 100644 index 0000000..0a2ebd8 --- /dev/null +++ b/shibsp/handler/impl/SAML2Consumer.cpp @@ -0,0 +1,406 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAML2Consumer.cpp + * + * SAML 2.0 assertion consumer service + */ + +#include "internal.h" +#include "handler/AssertionConsumerService.h" + +#ifndef SHIBSP_LITE +# include "exceptions.h" +# include "Application.h" +# include "ServiceProvider.h" +# include "SessionCache.h" +# include "attribute/resolver/ResolutionContext.h" +# include +# include +# include +# include +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +using namespace opensaml; +# ifndef min +# define min(a,b) (((a) < (b)) ? (a) : (b)) +# endif +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL SAML2Consumer : public AssertionConsumerService + { + public: + SAML2Consumer(const DOMElement* e, const char* appId) + : AssertionConsumerService(e, appId, Category::getInstance(SHIBSP_LOGCAT".SSO.SAML2")) { + } + virtual ~SAML2Consumer() {} + +#ifndef SHIBSP_LITE + void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + AssertionConsumerService::generateMetadata(role, handlerURL); + role.addSupport(samlconstants::SAML20P_NS); + } + + private: + void implementProtocol( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + SecurityPolicy& policy, + const PropertySet* settings, + const XMLObject& xmlObject + ) const; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL SAML2ConsumerFactory(const pair& p) + { + return new SAML2Consumer(p.first, p.second); + } + +}; + +#ifndef SHIBSP_LITE + +void SAML2Consumer::implementProtocol( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + SecurityPolicy& policy, + const PropertySet* settings, + const XMLObject& xmlObject + ) const +{ + // Implementation of SAML 2.0 SSO profile(s). + m_log.debug("processing message against SAML 2.0 SSO profile"); + + // Remember whether we already established trust. + // None of the SAML 2 bindings require security at the protocol layer. + bool alreadySecured = policy.isAuthenticated(); + + // Check for errors...this will throw if it's not a successful message. + checkError(&xmlObject); + + const Response* response = dynamic_cast(&xmlObject); + if (!response) + throw FatalProfileException("Incoming message was not a samlp:Response."); + + const vector& assertions = response->getAssertions(); + const vector& encassertions = response->getEncryptedAssertions(); + if (assertions.empty() && encassertions.empty()) + throw FatalProfileException("Incoming message contained no SAML assertions."); + + // Maintain list of "legit" tokens to feed to SP subsystems. + const Subject* ssoSubject=NULL; + const AuthnStatement* ssoStatement=NULL; + vector tokens; + + // Also track "bad" tokens that we'll cache but not use. + // This is necessary because there may be valid tokens not aimed at us. + vector badtokens; + + // And also track "owned" tokens that we decrypt here. + vector ownedtokens; + + // With this flag on, we ignore any unsigned assertions. + const EntityDescriptor* entity = NULL; + pair flag = make_pair(false,false); + if (alreadySecured && policy.getIssuerMetadata()) { + entity = dynamic_cast(policy.getIssuerMetadata()->getParent()); + flag = application.getRelyingParty(entity)->getBool("requireSignedAssertions"); + } + + time_t now = time(NULL); + string dest = httpRequest.getRequestURL(); + + // authnskew allows rejection of SSO if AuthnInstant is too old. + const PropertySet* sessionProps = application.getPropertySet("Sessions"); + pair authnskew = sessionProps ? sessionProps->getUnsignedInt("maxTimeSinceAuthn") : pair(false,0); + + // Saves off error messages potentially helpful for users. + string contextualError; + + for (vector::const_iterator a = assertions.begin(); a!=assertions.end(); ++a) { + try { + // Skip unsigned assertion? + if (!(*a)->getSignature() && flag.first && flag.second) + throw SecurityPolicyException("The incoming assertion was unsigned, violating local security policy."); + + // We clear the security flag, so we can tell whether the token was secured on its own. + policy.setAuthenticated(false); + policy.reset(true); + + // Extract message bits and re-verify Issuer information. + extractMessageDetails(*(*a), samlconstants::SAML20P_NS, policy); + + // Run the policy over the assertion. Handles replay, freshness, and + // signature verification, assuming the relevant rules are configured. + policy.evaluate(*(*a)); + + // If no security is in place now, we kick it. + if (!alreadySecured && !policy.isAuthenticated()) + throw SecurityPolicyException("Unable to establish security of incoming assertion."); + + // If we hadn't established Issuer yet, redo the signedAssertions check. + if (!entity && policy.getIssuerMetadata()) { + entity = dynamic_cast(policy.getIssuerMetadata()->getParent()); + flag = application.getRelyingParty(entity)->getBool("requireSignedAssertions"); + if (!(*a)->getSignature() && flag.first && flag.second) + throw SecurityPolicyException("The incoming assertion was unsigned, violating local security policy."); + } + + // Now do profile and core semantic validation to ensure we can use it for SSO. + BrowserSSOProfileValidator ssoValidator( + application.getRelyingParty(entity)->getXMLString("entityID").second, application.getAudiences(), now, dest.substr(0,dest.find('?')).c_str() + ); + ssoValidator.validateAssertion(*(*a)); + + // Address checking. + checkAddress(application, httpRequest, ssoValidator.getAddress()); + + // Track it as a valid token. + tokens.push_back(*a); + + // Save off the first valid SSO statement, but favor the "soonest" session expiration. + const vector& statements = const_cast(*a)->getAuthnStatements(); + for (vector::const_iterator s = statements.begin(); s!=statements.end(); ++s) { + if (authnskew.first && authnskew.second && (*s)->getAuthnInstant() && (now - (*s)->getAuthnInstantEpoch() > authnskew.second)) + contextualError = "The gap between now and the time you logged into your identity provider exceeds the limit."; + else if (!ssoStatement || (*s)->getSessionNotOnOrAfterEpoch() < ssoStatement->getSessionNotOnOrAfterEpoch()) + ssoStatement = *s; + } + + // Save off the first valid Subject, but favor an unencrypted NameID over anything else. + if (!ssoSubject || (!ssoSubject->getNameID() && (*a)->getSubject()->getNameID())) + ssoSubject = (*a)->getSubject(); + } + catch (exception& ex) { + m_log.warn("detected a problem with assertion: %s", ex.what()); + if (!ssoStatement) + contextualError = ex.what(); + badtokens.push_back(*a); + } + } + + // In case we need decryption... + CredentialResolver* cr=application.getCredentialResolver(); + if (!cr && !encassertions.empty()) + m_log.warn("found encrypted assertions, but no CredentialResolver was available"); + + for (vector::const_iterator ea = encassertions.begin(); cr && ea!=encassertions.end(); ++ea) { + // Attempt to decrypt it. + saml2::Assertion* decrypted=NULL; + try { + Locker credlocker(cr); + auto_ptr mcc( + policy.getIssuerMetadata() ? new MetadataCredentialCriteria(*policy.getIssuerMetadata()) : NULL + ); + auto_ptr wrapper((*ea)->decrypt(*cr, application.getRelyingParty(entity)->getXMLString("entityID").second, mcc.get())); + decrypted = dynamic_cast(wrapper.get()); + if (decrypted) { + wrapper.release(); + ownedtokens.push_back(decrypted); + if (m_log.isDebugEnabled()) + m_log.debugStream() << "decrypted Assertion: " << *decrypted << logging::eol; + } + } + catch (exception& ex) { + m_log.error(ex.what()); + } + if (!decrypted) + continue; + + try { + // Skip unsigned assertion? + if (!decrypted->getSignature() && flag.first && flag.second) + throw SecurityPolicyException("The incoming assertion was unsigned, violating local security policy."); + + // We clear the security flag, so we can tell whether the token was secured on its own. + policy.setAuthenticated(false); + policy.reset(true); + + // Extract message bits and re-verify Issuer information. + extractMessageDetails(*decrypted, samlconstants::SAML20P_NS, policy); + + // Run the policy over the assertion. Handles replay, freshness, and + // signature verification, assuming the relevant rules are configured. + // We have to marshall the object first to ensure signatures can be checked. + if (!decrypted->getDOM()) + decrypted->marshall(); + policy.evaluate(*decrypted); + + // If no security is in place now, we kick it. + if (!alreadySecured && !policy.isAuthenticated()) + throw SecurityPolicyException("Unable to establish security of incoming assertion."); + + // Now do profile and core semantic validation to ensure we can use it for SSO. + BrowserSSOProfileValidator ssoValidator( + application.getRelyingParty(entity)->getXMLString("entityID").second, application.getAudiences(), now, dest.substr(0,dest.find('?')).c_str() + ); + ssoValidator.validateAssertion(*decrypted); + + // Address checking. + checkAddress(application, httpRequest, ssoValidator.getAddress()); + + // Track it as a valid token. + tokens.push_back(decrypted); + + // Save off the first valid SSO statement, but favor the "soonest" session expiration. + const vector& statements = const_cast(decrypted)->getAuthnStatements(); + for (vector::const_iterator s = statements.begin(); s!=statements.end(); ++s) { + if (authnskew.first && authnskew.second && (*s)->getAuthnInstant() && (now - (*s)->getAuthnInstantEpoch() > authnskew.second)) + contextualError = "The gap between now and the time you logged into your identity provider exceeds the limit."; + else if (!ssoStatement || (*s)->getSessionNotOnOrAfterEpoch() < ssoStatement->getSessionNotOnOrAfterEpoch()) + ssoStatement = *s; + } + + // Save off the first valid Subject, but favor an unencrypted NameID over anything else. + if (!ssoSubject || (!ssoSubject->getNameID() && decrypted->getSubject()->getNameID())) + ssoSubject = decrypted->getSubject(); + } + catch (exception& ex) { + m_log.warn("detected a problem with assertion: %s", ex.what()); + if (!ssoStatement) + contextualError = ex.what(); + badtokens.push_back(decrypted); + } + } + + if (!ssoStatement) { + for_each(ownedtokens.begin(), ownedtokens.end(), xmltooling::cleanup()); + if (contextualError.empty()) + throw FatalProfileException("A valid authentication statement was not found in the incoming message."); + throw FatalProfileException(contextualError.c_str()); + } + + // May need to decrypt NameID. + bool ownedName = false; + NameID* ssoName = ssoSubject->getNameID(); + if (!ssoName) { + EncryptedID* encname = ssoSubject->getEncryptedID(); + if (encname) { + if (!cr) + m_log.warn("found encrypted NameID, but no decryption credential was available"); + else { + Locker credlocker(cr); + auto_ptr mcc( + policy.getIssuerMetadata() ? new MetadataCredentialCriteria(*policy.getIssuerMetadata()) : NULL + ); + try { + auto_ptr decryptedID(encname->decrypt(*cr,application.getRelyingParty(entity)->getXMLString("entityID").second,mcc.get())); + ssoName = dynamic_cast(decryptedID.get()); + if (ssoName) { + ownedName = true; + decryptedID.release(); + if (m_log.isDebugEnabled()) + m_log.debugStream() << "decrypted NameID: " << *ssoName << logging::eol; + } + } + catch (exception& ex) { + m_log.error(ex.what()); + } + } + } + } + + m_log.debug("SSO profile processing completed successfully"); + + // We've successfully "accepted" at least one SSO token, along with any additional valid tokens. + // To complete processing, we need to extract and resolve attributes and then create the session. + + // Now we have to extract the authentication details for session setup. + + // Session expiration for SAML 2.0 is jointly IdP- and SP-driven. + time_t sessionExp = ssoStatement->getSessionNotOnOrAfter() ? ssoStatement->getSessionNotOnOrAfterEpoch() : 0; + pair lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair(true,28800); + if (!lifetime.first || lifetime.second == 0) + lifetime.second = 28800; + if (sessionExp == 0) + sessionExp = now + lifetime.second; // IdP says nothing, calulate based on SP. + else + sessionExp = min(sessionExp, now + lifetime.second); // Use the lowest. + + const AuthnContext* authnContext = ssoStatement->getAuthnContext(); + + try { + // The context will handle deleting attributes and new tokens. + auto_ptr ctx( + resolveAttributes( + application, + policy.getIssuerMetadata(), + samlconstants::SAML20P_NS, + NULL, + ssoName, + (authnContext && authnContext->getAuthnContextClassRef()) ? authnContext->getAuthnContextClassRef()->getReference() : NULL, + (authnContext && authnContext->getAuthnContextDeclRef()) ? authnContext->getAuthnContextDeclRef()->getReference() : NULL, + &tokens + ) + ); + + if (ctx.get()) { + // Copy over any new tokens, but leave them in the context for cleanup. + tokens.insert(tokens.end(), ctx->getResolvedAssertions().begin(), ctx->getResolvedAssertions().end()); + } + + // Now merge in bad tokens for caching. + tokens.insert(tokens.end(), badtokens.begin(), badtokens.end()); + + application.getServiceProvider().getSessionCache()->insert( + application, + httpRequest, + httpResponse, + sessionExp, + entity, + samlconstants::SAML20P_NS, + ssoName, + ssoStatement->getAuthnInstant() ? ssoStatement->getAuthnInstant()->getRawData() : NULL, + ssoStatement->getSessionIndex(), + (authnContext && authnContext->getAuthnContextClassRef()) ? authnContext->getAuthnContextClassRef()->getReference() : NULL, + (authnContext && authnContext->getAuthnContextDeclRef()) ? authnContext->getAuthnContextDeclRef()->getReference() : NULL, + &tokens, + ctx.get() ? &ctx->getResolvedAttributes() : NULL + ); + + if (ownedName) + delete ssoName; + for_each(ownedtokens.begin(), ownedtokens.end(), xmltooling::cleanup()); + } + catch (exception&) { + if (ownedName) + delete ssoName; + for_each(ownedtokens.begin(), ownedtokens.end(), xmltooling::cleanup()); + throw; + } +} + +#endif diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp new file mode 100644 index 0000000..be80cb1 --- /dev/null +++ b/shibsp/handler/impl/SAML2Logout.cpp @@ -0,0 +1,602 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAML2Logout.cpp + * + * Handles SAML 2.0 single logout protocol messages. + */ + +#include "internal.h" +#include "exceptions.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "handler/AbstractHandler.h" +#include "handler/LogoutHandler.h" +#include "util/SPConstants.h" + +#ifndef SHIBSP_LITE +# include "SessionCacheEx.h" +# include "security/SecurityPolicy.h" +# include "util/TemplateParameters.h" +# include +# include +# include +# include +# include +# include +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +using namespace opensaml; +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL SAML2Logout : public AbstractHandler, public LogoutHandler + { + public: + SAML2Logout(const DOMElement* e, const char* appId); + virtual ~SAML2Logout() { +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + delete m_decoder; + XMLString::release(&m_outgoing); + for_each(m_encoders.begin(), m_encoders.end(), cleanup_pair()); + } +#endif + } + + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + const char* loc = getString("Location").second; + string hurl(handlerURL); + if (*loc != '/') + hurl += '/'; + hurl += loc; + auto_ptr_XMLCh widen(hurl.c_str()); + SingleLogoutService* ep = SingleLogoutServiceBuilder::buildSingleLogoutService(); + ep->setLocation(widen.get()); + ep->setBinding(getXMLString("Binding").second); + role.getSingleLogoutServices().push_back(ep); + role.addSupport(samlconstants::SAML20P_NS); + } + + const char* getType() const { + return "SingleLogoutService"; + } +#endif + + private: + pair doRequest(const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse) const; + +#ifndef SHIBSP_LITE + pair sendResponse( + const XMLCh* requestID, + const XMLCh* code, + const XMLCh* subcode, + const char* msg, + const char* relayState, + const RoleDescriptor* role, + const Application& application, + HTTPResponse& httpResponse, + bool front + ) const; + + QName m_role; + MessageDecoder* m_decoder; + XMLCh* m_outgoing; + vector m_bindings; + map m_encoders; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL SAML2LogoutFactory(const pair& p) + { + return new SAML2Logout(p.first, p.second); + } +}; + +SAML2Logout::SAML2Logout(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".Logout.SAML2")) +#ifndef SHIBSP_LITE + ,m_role(samlconstants::SAML20MD_NS, IDPSSODescriptor::LOCAL_NAME), m_decoder(NULL), m_outgoing(NULL) +#endif +{ +#ifndef SHIBSP_LITE + m_initiator = false; + m_preserve.push_back("ID"); + m_preserve.push_back("entityID"); + m_preserve.push_back("RelayState"); + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + SAMLConfig& conf = SAMLConfig::getConfig(); + + // Handle incoming binding. + m_decoder = conf.MessageDecoderManager.newPlugin( + getString("Binding").second, pair(e,shibspconstants::SHIB2SPCONFIG_NS) + ); + m_decoder->setArtifactResolver(SPConfig::getConfig().getArtifactResolver()); + + if (m_decoder->isUserAgentPresent()) { + // Handle front-channel binding setup. + pair outgoing = getXMLString("outgoingBindings", m_configNS.get()); + if (outgoing.first) { + m_outgoing = XMLString::replicate(outgoing.second); + XMLString::trim(m_outgoing); + } + else { + // No override, so we'll install a default binding precedence. + string prec = string(samlconstants::SAML20_BINDING_HTTP_REDIRECT) + ' ' + samlconstants::SAML20_BINDING_HTTP_POST + ' ' + + samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN + ' ' + samlconstants::SAML20_BINDING_HTTP_ARTIFACT; + m_outgoing = XMLString::transcode(prec.c_str()); + } + + int pos; + XMLCh* start = m_outgoing; + while (start && *start) { + pos = XMLString::indexOf(start,chSpace); + if (pos != -1) + *(start + pos)=chNull; + m_bindings.push_back(start); + try { + auto_ptr_char b(start); + MessageEncoder * encoder = conf.MessageEncoderManager.newPlugin( + b.get(), pair(e,shibspconstants::SHIB2SPCONFIG_NS) + ); + m_encoders[start] = encoder; + m_log.debug("supporting outgoing front-channel binding (%s)", b.get()); + } + catch (exception& ex) { + m_log.error("error building MessageEncoder: %s", ex.what()); + } + if (pos != -1) + start = start + pos + 1; + else + break; + } + } + else { + MessageEncoder* encoder = conf.MessageEncoderManager.newPlugin( + getString("Binding").second, pair(e,shibspconstants::SHIB2SPCONFIG_NS) + ); + m_encoders.insert(pair(NULL, encoder)); + } + } +#endif + + string address(appId); + address += getString("Location").second; + setAddress(address.c_str()); +} + +pair SAML2Logout::run(SPRequest& request, bool isHandler) const +{ + // Defer to base class for front-channel loop first. + // This won't initiate the loop, only continue/end it. + pair ret = LogoutHandler::run(request, isHandler); + if (ret.first) + return ret; + + SPConfig& conf = SPConfig::getConfig(); + if (conf.isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively and directly process the message. + return doRequest(request.getApplication(), request, request); + } + else { + // When not out of process, we remote all the message processing. + vector headers(1,"Cookie"); + DDF out,in = wrap(request, &headers, true); + DDFJanitor jin(in), jout(out); + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } +} + +void SAML2Logout::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for logout", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for logout, deleted?"); + } + + // Unpack the request. + auto_ptr req(getRequest(in)); + + // Wrap a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + // Since we're remoted, the result should either be a throw, which we pass on, + // a false/0 return, which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + doRequest(*app, *req.get(), *resp.get()); + out << ret; +} + +pair SAML2Logout::doRequest(const Application& application, const HTTPRequest& request, HTTPResponse& response) const +{ +#ifndef SHIBSP_LITE + // First capture the active session ID. + SessionCache* cache = application.getServiceProvider().getSessionCache(); + SessionCacheEx* cacheex = dynamic_cast(cache); + string session_id = cache->active(application, request); + + if (!strcmp(request.getMethod(),"GET") && request.getParameter("notifying")) { + // This is returning from a front-channel notification, so we have to do the back-channel and then + // respond. To do that, we need state from the original request. + if (!request.getParameter("entityID")) { + cache->remove(application, request, &response); + throw FatalProfileException("Application notification loop did not return entityID for LogoutResponse."); + } + + // Best effort on back channel and to remove the user agent's session. + bool worked1 = false,worked2 = false; + if (!session_id.empty()) { + vector sessions(1,session_id); + worked1 = notifyBackChannel(application, request.getRequestURL(), sessions, false); + try { + cache->remove(application, request, &response); + worked2 = true; + } + catch (exception& ex) { + m_log.error("error removing session (%s): %s", session_id, ex.what()); + } + } + else { + worked1 = worked2 = true; + } + + // We need metadata to issue a response. + MetadataProvider* m = application.getMetadataProvider(); + Locker metadataLocker(m); + MetadataProvider::Criteria mc(request.getParameter("entityID"), &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS); + pair entity = m->getEntityDescriptor(mc); + if (!entity.first) { + throw MetadataException( + "Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", request.getParameter("entityID")) + ); + } + else if (!entity.second) { + throw MetadataException( + "Unable to locate SAML 2.0 IdP role for identity provider ($entityID).", + namedparams(1, "entityID", request.getParameter("entityID")) + ); + } + + auto_ptr_XMLCh reqid(request.getParameter("ID")); + if (worked1 && worked2) { + // Successful LogoutResponse. Has to be front-channel or we couldn't be here. + return sendResponse( + reqid.get(), StatusCode::SUCCESS, NULL, NULL, request.getParameter("RelayState"), entity.second, application, response, true + ); + } + + return sendResponse( + reqid.get(), + StatusCode::RESPONDER, NULL, "Unable to fully destroy principal's session.", + request.getParameter("RelayState"), + entity.second, + application, + response, + true + ); + } + + // If we get here, it's an external protocol message to decode. + + // Locate policy key. + pair policyId = getString("policyId", m_configNS.get()); // namespace-qualified if inside handler element + if (!policyId.first) + policyId = application.getString("policyId"); // unqualified in Application(s) element + + // Access policy properties. + const PropertySet* settings = application.getServiceProvider().getPolicySettings(policyId.second); + pair validate = settings->getBool("validate"); + + // Lock metadata for use by policy. + Locker metadataLocker(application.getMetadataProvider()); + + // Create the policy. + shibsp::SecurityPolicy policy(application, &m_role, validate.first && validate.second); + + // Decode the message. + string relayState; + auto_ptr msg(m_decoder->decode(relayState, request, policy)); + const LogoutRequest* logoutRequest = dynamic_cast(msg.get()); + if (logoutRequest) { + if (!policy.isAuthenticated()) + throw SecurityPolicyException("Security of LogoutRequest not established."); + + // Message from IdP to logout one or more sessions. + + // If this is front-channel, we have to have a session_id to use already. + if (m_decoder->isUserAgentPresent() && session_id.empty()) { + m_log.error("no active session"); + return sendResponse( + logoutRequest->getID(), + StatusCode::REQUESTER, StatusCode::UNKNOWN_PRINCIPAL, "No active session found in request.", + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + true + ); + } + + bool ownedName = false; + NameID* nameid = logoutRequest->getNameID(); + if (!nameid) { + // Check for EncryptedID. + EncryptedID* encname = logoutRequest->getEncryptedID(); + if (encname) { + CredentialResolver* cr=application.getCredentialResolver(); + if (!cr) + m_log.warn("found encrypted NameID, but no decryption credential was available"); + else { + Locker credlocker(cr); + auto_ptr mcc( + policy.getIssuerMetadata() ? new MetadataCredentialCriteria(*policy.getIssuerMetadata()) : NULL + ); + try { + auto_ptr decryptedID( + encname->decrypt( + *cr, + application.getRelyingParty(policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : NULL)->getXMLString("entityID").second, + mcc.get() + ) + ); + nameid = dynamic_cast(decryptedID.get()); + if (nameid) { + ownedName = true; + decryptedID.release(); + } + } + catch (exception& ex) { + m_log.error(ex.what()); + } + } + } + } + if (!nameid) { + // No NameID, so must respond with an error. + m_log.error("NameID not found in request"); + return sendResponse( + logoutRequest->getID(), + StatusCode::REQUESTER, StatusCode::UNKNOWN_PRINCIPAL, "NameID not found in request.", + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + m_decoder->isUserAgentPresent() + ); + } + + auto_ptr namewrapper(ownedName ? nameid : NULL); + + // Suck indexes out of the request for next steps. + set indexes; + EntityDescriptor* entity = policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : NULL; + const vector sindexes = logoutRequest->getSessionIndexs(); + for (vector::const_iterator i = sindexes.begin(); i != sindexes.end(); ++i) { + auto_ptr_char sindex((*i)->getSessionIndex()); + indexes.insert(sindex.get()); + } + + // For a front-channel LogoutRequest, we have to match the information in the request + // against the current session. + if (!session_id.empty()) { + if (!cache->matches(application, request, entity, *nameid, &indexes)) { + return sendResponse( + logoutRequest->getID(), + StatusCode::REQUESTER, StatusCode::REQUEST_DENIED, "Active session did not match logout request.", + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + true + ); + } + + } + + // Now we perform "logout" by finding the matching sessions. + vector sessions; + try { + if (cacheex) { + time_t expires = logoutRequest->getNotOnOrAfter() ? logoutRequest->getNotOnOrAfterEpoch() : 0; + cacheex->logout(application, entity, *nameid, &indexes, expires, sessions); + + // Now we actually terminate everything except for the active session, + // if this is front-channel, for notification purposes. + for (vector::const_iterator sit = sessions.begin(); sit != sessions.end(); ++sit) + if (*sit != session_id) + cacheex->remove(application, sit->c_str()); // using the ID-based removal operation + } + else { + m_log.warn("session cache does not support extended API, can't implement indirect logout of sessions"); + if (!session_id.empty()) + sessions.push_back(session_id); + } + } + catch (exception& ex) { + m_log.error("error while logging out matching sessions: %s", ex.what()); + return sendResponse( + logoutRequest->getID(), + StatusCode::RESPONDER, NULL, ex.what(), + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + m_decoder->isUserAgentPresent() + ); + } + + if (m_decoder->isUserAgentPresent()) { + // Pass control to the first front channel notification point, if any. + map parammap; + if (!relayState.empty()) + parammap["RelayState"] = relayState; + auto_ptr_char entityID(entity ? entity->getEntityID() : NULL); + if (entityID.get()) + parammap["entityID"] = entityID.get(); + auto_ptr_char reqID(logoutRequest->getID()); + if (reqID.get()) + parammap["ID"] = reqID.get(); + pair result = notifyFrontChannel(application, request, response, ¶mmap); + if (result.first) + return result; + } + + // For back-channel requests, or if no front-channel notification is needed... + bool worked1 = false,worked2 = false; + worked1 = notifyBackChannel(application, request.getRequestURL(), sessions, false); + if (!session_id.empty()) { + // One last session to yoink... + try { + cache->remove(application, request, &response); + worked2 = true; + } + catch (exception& ex) { + m_log.error("error removing active session (%s): %s", session_id.c_str(), ex.what()); + } + } + + return sendResponse( + logoutRequest->getID(), + (worked1 && worked2) ? StatusCode::SUCCESS : StatusCode::RESPONDER, + (worked1 && worked2) ? NULL : StatusCode::PARTIAL_LOGOUT, + NULL, + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + m_decoder->isUserAgentPresent() + ); + } + + // A LogoutResponse completes an SP-initiated logout sequence. + const LogoutResponse* logoutResponse = dynamic_cast(msg.get()); + if (logoutResponse) { + if (!policy.isAuthenticated()) { + SecurityPolicyException ex("Security of LogoutResponse not established."); + if (policy.getIssuerMetadata()) + annotateException(&ex, policy.getIssuerMetadata()); // throws it + ex.raise(); + } + checkError(logoutResponse, policy.getIssuerMetadata()); // throws if Status doesn't look good... + + // If relay state is set, recover the original return URL. + if (!relayState.empty()) + recoverRelayState(application, request, response, relayState); + if (!relayState.empty()) + return make_pair(true, response.sendRedirect(relayState.c_str())); + + // Return template for completion of global logout, or redirect to homeURL. + return sendLogoutPage(application, request, response, false, "Global logout completed."); + } + + FatalProfileException ex("Incoming message was not a samlp:LogoutRequest or samlp:LogoutResponse."); + if (policy.getIssuerMetadata()) + annotateException(&ex, policy.getIssuerMetadata()); // throws it + ex.raise(); + return make_pair(false,0L); // never happen, satisfies compiler +#else + throw ConfigurationException("Cannot process logout message using lite version of shibsp library."); +#endif +} + +#ifndef SHIBSP_LITE + +pair SAML2Logout::sendResponse( + const XMLCh* requestID, + const XMLCh* code, + const XMLCh* subcode, + const char* msg, + const char* relayState, + const RoleDescriptor* role, + const Application& application, + HTTPResponse& httpResponse, + bool front + ) const +{ + // Get endpoint and encoder to use. + const EndpointType* ep = NULL; + const MessageEncoder* encoder = NULL; + if (front) { + const IDPSSODescriptor* idp = dynamic_cast(role); + for (vector::const_iterator b = m_bindings.begin(); idp && b!=m_bindings.end(); ++b) { + if (ep=EndpointManager(idp->getSingleLogoutServices()).getByBinding(*b)) { + map::const_iterator enc = m_encoders.find(*b); + if (enc!=m_encoders.end()) + encoder = enc->second; + break; + } + } + if (!ep || !encoder) { + auto_ptr_char id(dynamic_cast(role->getParent())->getEntityID()); + m_log.error("unable to locate compatible SLO service for provider (%s)", id.get()); + MetadataException ex("Unable to locate endpoint at IdP ($entityID) to send LogoutResponse."); + annotateException(&ex, role); // throws it + } + } + else { + encoder = m_encoders.begin()->second; + } + + // Prepare response. + auto_ptr logout(LogoutResponseBuilder::buildLogoutResponse()); + logout->setInResponseTo(requestID); + if (ep) { + const XMLCh* loc = ep->getResponseLocation(); + if (!loc || !*loc) + loc = ep->getLocation(); + logout->setDestination(loc); + } + Issuer* issuer = IssuerBuilder::buildIssuer(); + logout->setIssuer(issuer); + issuer->setName(application.getRelyingParty(dynamic_cast(role->getParent()))->getXMLString("entityID").second); + fillStatus(*logout.get(), code, subcode, msg); + + auto_ptr_char dest(logout->getDestination()); + + long ret = sendMessage(*encoder, logout.get(), relayState, dest.get(), role, application, httpResponse); + logout.release(); // freed by encoder + return make_pair(true,ret); +} + +#endif diff --git a/shibsp/handler/impl/SAML2LogoutInitiator.cpp b/shibsp/handler/impl/SAML2LogoutInitiator.cpp new file mode 100644 index 0000000..400989c --- /dev/null +++ b/shibsp/handler/impl/SAML2LogoutInitiator.cpp @@ -0,0 +1,482 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAML2LogoutInitiator.cpp + * + * Triggers SP-initiated logout for SAML 2.0 sessions. + */ + +#include "internal.h" +#include "exceptions.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "handler/AbstractHandler.h" +#include "handler/LogoutHandler.h" + +#ifndef SHIBSP_LITE +# include "binding/SOAPClient.h" +# include +# include +# include +# include +# include +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +using namespace opensaml; +#else +# include "lite/SAMLConstants.h" +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL SAML2LogoutInitiator : public AbstractHandler, public LogoutHandler + { + public: + SAML2LogoutInitiator(const DOMElement* e, const char* appId); + virtual ~SAML2LogoutInitiator() { +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + XMLString::release(&m_outgoing); + for_each(m_encoders.begin(), m_encoders.end(), cleanup_pair()); + } +#endif + } + + void setParent(const PropertySet* parent); + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + const char* getType() const { + return "LogoutInitiator"; + } +#endif + + private: + pair doRequest( + const Application& application, const HTTPRequest& request, HTTPResponse& httpResponse, Session* session + ) const; + + string m_appId; +#ifndef SHIBSP_LITE + LogoutRequest* buildRequest( + const Application& application, const Session& session, const RoleDescriptor& role, const MessageEncoder* encoder=NULL + ) const; + + XMLCh* m_outgoing; + vector m_bindings; + map m_encoders; +#endif + auto_ptr_char m_protocol; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL SAML2LogoutInitiatorFactory(const pair& p) + { + return new SAML2LogoutInitiator(p.first, p.second); + } +}; + +SAML2LogoutInitiator::SAML2LogoutInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".LogoutInitiator.SAML2")), m_appId(appId), +#ifndef SHIBSP_LITE + m_outgoing(NULL), +#endif + m_protocol(samlconstants::SAML20P_NS) +{ +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + // Handle outgoing binding setup. + pair outgoing = getXMLString("outgoingBindings"); + if (outgoing.first) { + m_outgoing = XMLString::replicate(outgoing.second); + XMLString::trim(m_outgoing); + } + else { + // No override, so we'll install a default binding precedence. + string prec = string(samlconstants::SAML20_BINDING_HTTP_REDIRECT) + ' ' + samlconstants::SAML20_BINDING_HTTP_POST + ' ' + + samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN + ' ' + samlconstants::SAML20_BINDING_HTTP_ARTIFACT; + m_outgoing = XMLString::transcode(prec.c_str()); + } + + int pos; + XMLCh* start = m_outgoing; + while (start && *start) { + pos = XMLString::indexOf(start,chSpace); + if (pos != -1) + *(start + pos)=chNull; + m_bindings.push_back(start); + try { + auto_ptr_char b(start); + MessageEncoder * encoder = + SAMLConfig::getConfig().MessageEncoderManager.newPlugin(b.get(),pair(e,NULL)); + m_encoders[start] = encoder; + m_log.debug("supporting outgoing binding (%s)", b.get()); + } + catch (exception& ex) { + m_log.error("error building MessageEncoder: %s", ex.what()); + } + if (pos != -1) + start = start + pos + 1; + else + break; + } + } +#endif + + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::SAML2LI"; + setAddress(address.c_str()); + } +} + +void SAML2LogoutInitiator::setParent(const PropertySet* parent) +{ + DOMPropertySet::setParent(parent); + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::SAML2LI"; + setAddress(address.c_str()); + } + else { + m_log.warn("no Location property in SAML2 LogoutInitiator (or parent), can't register as remoted handler"); + } +} + +pair SAML2LogoutInitiator::run(SPRequest& request, bool isHandler) const +{ + // Defer to base class for front-channel loop first. + pair ret = LogoutHandler::run(request, isHandler); + if (ret.first) + return ret; + + // At this point we know the front-channel is handled. + // We need the session to do any other work. + + Session* session = NULL; + try { + session = request.getSession(false, true, false); // don't cache it and ignore all checks + if (!session) + return make_pair(false,0L); + + // We only handle SAML 2.0 sessions. + if (!XMLString::equals(session->getProtocol(), m_protocol.get())) { + session->unlock(); + return make_pair(false,0L); + } + } + catch (exception& ex) { + m_log.error("error accessing current session: %s", ex.what()); + return make_pair(false,0L); + } + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively. + return doRequest(request.getApplication(), request, request, session); + } + else { + // When not out of process, we remote the request. + session->unlock(); + vector headers(1,"Cookie"); + DDF out,in = wrap(request,&headers); + DDFJanitor jin(in), jout(out); + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } +} + +void SAML2LogoutInitiator::receive(DDF& in, ostream& out) +{ +#ifndef SHIBSP_LITE + // Defer to base class for notifications + if (in["notify"].integer() == 1) + return LogoutHandler::receive(in, out); + + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for logout", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for logout, deleted?"); + } + + // Unpack the request. + auto_ptr req(getRequest(in)); + + // Set up a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + Session* session = NULL; + try { + session = app->getServiceProvider().getSessionCache()->find(*app, *req.get(), NULL, NULL); + } + catch (exception& ex) { + m_log.error("error accessing current session: %s", ex.what()); + } + + // With no session, we just skip the request and let it fall through to an empty struct return. + if (session) { + if (session->getNameID() && session->getEntityID()) { + // Since we're remoted, the result should either be a throw, which we pass on, + // a false/0 return, which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + doRequest(*app, *req.get(), *resp.get(), session); + } + else { + m_log.error("no NameID or issuing entityID found in session"); + session->unlock(); + app->getServiceProvider().getSessionCache()->remove(*app, *req.get(), resp.get()); + } + } + out << ret; +#else + throw ConfigurationException("Cannot perform logout using lite version of shibsp library."); +#endif +} + +pair SAML2LogoutInitiator::doRequest( + const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse, Session* session + ) const +{ + // Do back channel notification. + vector sessions(1, session->getID()); + if (!notifyBackChannel(application, httpRequest.getRequestURL(), sessions, false)) { + session->unlock(); + application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse); + return sendLogoutPage(application, httpRequest, httpResponse, true, "Partial logout failure."); + } + +#ifndef SHIBSP_LITE + pair ret = make_pair(false,0L); + try { + // With a session in hand, we can create a LogoutRequest message, if we can find a compatible endpoint. + MetadataProvider* m = application.getMetadataProvider(); + Locker metadataLocker(m); + MetadataProvider::Criteria mc(session->getEntityID(), &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS); + pair entity = m->getEntityDescriptor(mc); + if (!entity.first) { + throw MetadataException( + "Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", session->getEntityID()) + ); + } + else if (!entity.second) { + throw MetadataException( + "Unable to locate SAML 2.0 IdP role for identity provider ($entityID).", namedparams(1, "entityID", session->getEntityID()) + ); + } + + const IDPSSODescriptor* role = dynamic_cast(entity.second); + const EndpointType* ep=NULL; + const MessageEncoder* encoder=NULL; + vector::const_iterator b; + for (b = m_bindings.begin(); b!=m_bindings.end(); ++b) { + if (ep=EndpointManager(role->getSingleLogoutServices()).getByBinding(*b)) { + map::const_iterator enc = m_encoders.find(*b); + if (enc!=m_encoders.end()) + encoder = enc->second; + break; + } + } + if (!ep || !encoder) { + m_log.warn("no compatible front channel SingleLogoutService, trying back channel..."); + shibsp::SecurityPolicy policy(application); + shibsp::SOAPClient soaper(policy); + MetadataCredentialCriteria mcc(*role); + + LogoutResponse* logoutResponse=NULL; + auto_ptr_XMLCh binding(samlconstants::SAML20_BINDING_SOAP); + const vector& endpoints=role->getSingleLogoutServices(); + for (vector::const_iterator epit=endpoints.begin(); !logoutResponse && epit!=endpoints.end(); ++epit) { + try { + if (!XMLString::equals((*epit)->getBinding(),binding.get())) + continue; + LogoutRequest* msg = buildRequest(application, *session, *role); + auto_ptr_char dest((*epit)->getLocation()); + + SAML2SOAPClient client(soaper, false); + client.sendSAML(msg, application.getId(), mcc, dest.get()); + StatusResponseType* srt = client.receiveSAML(); + if (!(logoutResponse = dynamic_cast(srt))) { + delete srt; + break; + } + } + catch (exception& ex) { + m_log.error("error sending LogoutRequest message: %s", ex.what()); + soaper.reset(); + } + } + + if (!logoutResponse) + ret = sendLogoutPage(application, httpRequest, httpResponse, false, "Identity provider did not respond to logout request."); + else if (!logoutResponse->getStatus() || !logoutResponse->getStatus()->getStatusCode() || + !XMLString::equals(logoutResponse->getStatus()->getStatusCode()->getValue(), saml2p::StatusCode::SUCCESS)) { + delete logoutResponse; + ret = sendLogoutPage(application, httpRequest, httpResponse, false, "Identity provider returned a SAML error in response to logout request."); + } + else { + delete logoutResponse; + const char* returnloc = httpRequest.getParameter("return"); + if (returnloc) { + ret.second = httpResponse.sendRedirect(returnloc); + ret.first = true; + } + ret = sendLogoutPage(application, httpRequest, httpResponse, false, "Logout completed successfully."); + } + + if (session) { + session->unlock(); + session = NULL; + application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse); + } + return ret; + } + + // Save off return location as RelayState. + string relayState; + const char* returnloc = httpRequest.getParameter("return"); + if (returnloc) { + relayState = returnloc; + preserveRelayState(application, httpResponse, relayState); + } + + auto_ptr msg(buildRequest(application, *session, *role, encoder)); + + msg->setDestination(ep->getLocation()); + auto_ptr_char dest(ep->getLocation()); + ret.second = sendMessage(*encoder, msg.get(), relayState.c_str(), dest.get(), role, application, httpResponse); + ret.first = true; + msg.release(); // freed by encoder + } + catch (exception& ex) { + m_log.error("error issuing SAML 2.0 logout request: %s", ex.what()); + } + + if (session) { + session->unlock(); + session = NULL; + application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse); + } + + return ret; +#else + session->unlock(); + application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse); + throw ConfigurationException("Cannot perform logout using lite version of shibsp library."); +#endif +} + +#ifndef SHIBSP_LITE + +LogoutRequest* SAML2LogoutInitiator::buildRequest( + const Application& application, const Session& session, const RoleDescriptor& role, const MessageEncoder* encoder + ) const +{ + const PropertySet* relyingParty = application.getRelyingParty(dynamic_cast(role.getParent())); + + auto_ptr msg(LogoutRequestBuilder::buildLogoutRequest()); + Issuer* issuer = IssuerBuilder::buildIssuer(); + msg->setIssuer(issuer); + issuer->setName(relyingParty->getXMLString("entityID").second); + auto_ptr_XMLCh index(session.getSessionIndex()); + if (index.get() && *index.get()) { + SessionIndex* si = SessionIndexBuilder::buildSessionIndex(); + msg->getSessionIndexs().push_back(si); + si->setSessionIndex(index.get()); + } + + const NameID* nameid = session.getNameID(); + pair flag = relyingParty->getString("encryption"); + if (flag.first && + (!strcmp(flag.second, "true") || (encoder && !strcmp(flag.second, "front")) || (!encoder && !strcmp(flag.second, "back")))) { + auto_ptr encrypted(EncryptedIDBuilder::buildEncryptedID()); + MetadataCredentialCriteria mcc(role); + encrypted->encrypt( + *nameid, + *(application.getMetadataProvider()), + mcc, + encoder ? encoder->isCompact() : false, + relyingParty->getXMLString("encryptionAlg").second + ); + msg->setEncryptedID(encrypted.release()); + } + + if (!encoder) { + // No encoder being used, so sign for SOAP client manually. + flag = relyingParty->getString("signing"); + if (flag.first && (!strcmp(flag.second, "true") || !strcmp(flag.second, "back"))) { + CredentialResolver* credResolver=application.getCredentialResolver(); + if (credResolver) { + Locker credLocker(credResolver); + // Fill in criteria to use. + MetadataCredentialCriteria mcc(role); + mcc.setUsage(Credential::SIGNING_CREDENTIAL); + pair keyName = relyingParty->getString("keyName"); + if (keyName.first) + mcc.getKeyNames().insert(keyName.second); + pair sigalg = relyingParty->getXMLString("signingAlg"); + if (sigalg.first) + mcc.setXMLAlgorithm(sigalg.second); + const Credential* cred = credResolver->resolve(&mcc); + if (cred) { + xmlsignature::Signature* sig = xmlsignature::SignatureBuilder::buildSignature(); + msg->setSignature(sig); + if (sigalg.first) + sig->setSignatureAlgorithm(sigalg.second); + sigalg = relyingParty->getXMLString("digestAlg"); + if (sigalg.first) { + ContentReference* cr = dynamic_cast(sig->getContentReference()); + if (cr) + cr->setDigestAlgorithm(sigalg.second); + } + + // Sign response while marshalling. + vector sigs(1,sig); + msg->marshall((DOMDocument*)NULL,&sigs,cred); + } + else { + m_log.warn("no signing credential resolved, leaving message unsigned"); + } + } + else { + m_log.warn("no credential resolver installed, leaving message unsigned"); + } + } + } + + return msg.release(); +} + +#endif diff --git a/shibsp/handler/impl/SAML2NameIDMgmt.cpp b/shibsp/handler/impl/SAML2NameIDMgmt.cpp new file mode 100644 index 0000000..4aba9a6 --- /dev/null +++ b/shibsp/handler/impl/SAML2NameIDMgmt.cpp @@ -0,0 +1,589 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAML2NameIDMgmt.cpp + * + * Handles SAML 2.0 NameID management protocol messages. + */ + +#include "internal.h" +#include "exceptions.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" +#include "util/SPConstants.h" + +#ifndef SHIBSP_LITE +# include "SessionCache.h" +# include "security/SecurityPolicy.h" +# include "util/TemplateParameters.h" +# include +# include +# include +# include +# include +# include +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +using namespace opensaml; +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL SAML2NameIDMgmt : public AbstractHandler, public RemotedHandler + { + public: + SAML2NameIDMgmt(const DOMElement* e, const char* appId); + virtual ~SAML2NameIDMgmt() { +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + delete m_decoder; + XMLString::release(&m_outgoing); + for_each(m_encoders.begin(), m_encoders.end(), cleanup_pair()); + } +#endif + } + + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + const char* loc = getString("Location").second; + string hurl(handlerURL); + if (*loc != '/') + hurl += '/'; + hurl += loc; + auto_ptr_XMLCh widen(hurl.c_str()); + ManageNameIDService* ep = ManageNameIDServiceBuilder::buildManageNameIDService(); + ep->setLocation(widen.get()); + ep->setBinding(getXMLString("Binding").second); + role.getManageNameIDServices().push_back(ep); + role.addSupport(samlconstants::SAML20P_NS); + } + + const char* getType() const { + return "ManageNameIDService"; + } +#endif + + private: + pair doRequest(const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse) const; + +#ifndef SHIBSP_LITE + bool notifyBackChannel(const Application& application, const char* requestURL, const NameID& nameid, const NewID* newid) const; + + pair sendResponse( + const XMLCh* requestID, + const XMLCh* code, + const XMLCh* subcode, + const char* msg, + const char* relayState, + const RoleDescriptor* role, + const Application& application, + HTTPResponse& httpResponse, + bool front + ) const; + + QName m_role; + MessageDecoder* m_decoder; + XMLCh* m_outgoing; + vector m_bindings; + map m_encoders; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL SAML2NameIDMgmtFactory(const pair& p) + { + return new SAML2NameIDMgmt(p.first, p.second); + } +}; + +SAML2NameIDMgmt::SAML2NameIDMgmt(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".NameIDMgmt.SAML2")) +#ifndef SHIBSP_LITE + ,m_role(samlconstants::SAML20MD_NS, IDPSSODescriptor::LOCAL_NAME), m_decoder(NULL), m_outgoing(NULL) +#endif +{ +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + SAMLConfig& conf = SAMLConfig::getConfig(); + + // Handle incoming binding. + m_decoder = conf.MessageDecoderManager.newPlugin( + getString("Binding").second, pair(e,shibspconstants::SHIB2SPCONFIG_NS) + ); + m_decoder->setArtifactResolver(SPConfig::getConfig().getArtifactResolver()); + + if (m_decoder->isUserAgentPresent()) { + // Handle front-channel binding setup. + pair outgoing = getXMLString("outgoingBindings", m_configNS.get()); + if (outgoing.first) { + m_outgoing = XMLString::replicate(outgoing.second); + XMLString::trim(m_outgoing); + } + else { + // No override, so we'll install a default binding precedence. + string prec = string(samlconstants::SAML20_BINDING_HTTP_REDIRECT) + ' ' + samlconstants::SAML20_BINDING_HTTP_POST + ' ' + + samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN + ' ' + samlconstants::SAML20_BINDING_HTTP_ARTIFACT; + m_outgoing = XMLString::transcode(prec.c_str()); + } + + int pos; + XMLCh* start = m_outgoing; + while (start && *start) { + pos = XMLString::indexOf(start,chSpace); + if (pos != -1) + *(start + pos)=chNull; + m_bindings.push_back(start); + try { + auto_ptr_char b(start); + MessageEncoder * encoder = conf.MessageEncoderManager.newPlugin( + b.get(), pair(e,shibspconstants::SHIB2SPCONFIG_NS) + ); + m_encoders[start] = encoder; + m_log.debug("supporting outgoing front-channel binding (%s)", b.get()); + } + catch (exception& ex) { + m_log.error("error building MessageEncoder: %s", ex.what()); + } + if (pos != -1) + start = start + pos + 1; + else + break; + } + } + else { + MessageEncoder* encoder = conf.MessageEncoderManager.newPlugin( + getString("Binding").second, pair(e,shibspconstants::SHIB2SPCONFIG_NS) + ); + m_encoders.insert(pair(NULL, encoder)); + } + } +#endif + + string address(appId); + address += getString("Location").second; + setAddress(address.c_str()); +} + +pair SAML2NameIDMgmt::run(SPRequest& request, bool isHandler) const +{ + SPConfig& conf = SPConfig::getConfig(); + if (conf.isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively and directly process the message. + return doRequest(request.getApplication(), request, request); + } + else { + // When not out of process, we remote all the message processing. + vector headers(1,"Cookie"); + DDF out,in = wrap(request, &headers, true); + DDFJanitor jin(in), jout(out); + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } +} + +void SAML2NameIDMgmt::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for NameID mgmt", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for NameID mgmt, deleted?"); + } + + // Unpack the request. + auto_ptr req(getRequest(in)); + + // Wrap a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr resp(getResponse(ret)); + + // Since we're remoted, the result should either be a throw, which we pass on, + // a false/0 return, which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + doRequest(*app, *req.get(), *resp.get()); + out << ret; +} + +pair SAML2NameIDMgmt::doRequest( + const Application& application, const HTTPRequest& request, HTTPResponse& response + ) const +{ +#ifndef SHIBSP_LITE + SessionCache* cache = application.getServiceProvider().getSessionCache(); + + // Locate policy key. + pair policyId = getString("policyId", m_configNS.get()); // namespace-qualified if inside handler element + if (!policyId.first) + policyId = application.getString("policyId"); // unqualified in Application(s) element + + // Access policy properties. + const PropertySet* settings = application.getServiceProvider().getPolicySettings(policyId.second); + pair validate = settings->getBool("validate"); + + // Lock metadata for use by policy. + Locker metadataLocker(application.getMetadataProvider()); + + // Create the policy. + shibsp::SecurityPolicy policy(application, &m_role, validate.first && validate.second); + + // Decode the message. + string relayState; + auto_ptr msg(m_decoder->decode(relayState, request, policy)); + const ManageNameIDRequest* mgmtRequest = dynamic_cast(msg.get()); + if (mgmtRequest) { + if (!policy.isAuthenticated()) + throw SecurityPolicyException("Security of ManageNameIDRequest not established."); + + // Message from IdP to change or terminate a NameID. + + // If this is front-channel, we have to have a session_id to use already. + string session_id = cache->active(application, request); + if (m_decoder->isUserAgentPresent() && session_id.empty()) { + m_log.error("no active session"); + return sendResponse( + mgmtRequest->getID(), + StatusCode::REQUESTER, StatusCode::UNKNOWN_PRINCIPAL, "No active session found in request.", + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + true + ); + } + + EntityDescriptor* entity = policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : NULL; + + bool ownedName = false; + NameID* nameid = mgmtRequest->getNameID(); + if (!nameid) { + // Check for EncryptedID. + EncryptedID* encname = mgmtRequest->getEncryptedID(); + if (encname) { + CredentialResolver* cr=application.getCredentialResolver(); + if (!cr) + m_log.warn("found encrypted NameID, but no decryption credential was available"); + else { + Locker credlocker(cr); + auto_ptr mcc( + policy.getIssuerMetadata() ? new MetadataCredentialCriteria(*policy.getIssuerMetadata()) : NULL + ); + try { + auto_ptr decryptedID(encname->decrypt(*cr,application.getRelyingParty(entity)->getXMLString("entityID").second,mcc.get())); + nameid = dynamic_cast(decryptedID.get()); + if (nameid) { + ownedName = true; + decryptedID.release(); + } + } + catch (exception& ex) { + m_log.error(ex.what()); + } + } + } + } + if (!nameid) { + // No NameID, so must respond with an error. + m_log.error("NameID not found in request"); + return sendResponse( + mgmtRequest->getID(), + StatusCode::REQUESTER, StatusCode::UNKNOWN_PRINCIPAL, "NameID not found in request.", + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + m_decoder->isUserAgentPresent() + ); + } + + auto_ptr namewrapper(ownedName ? nameid : NULL); + + // For a front-channel request, we have to match the information in the request + // against the current session. + if (!session_id.empty()) { + if (!cache->matches(application, request, entity, *nameid, NULL)) { + return sendResponse( + mgmtRequest->getID(), + StatusCode::REQUESTER, StatusCode::REQUEST_DENIED, "Active session did not match NameID mgmt request.", + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + true + ); + } + + } + + // Determine what's happening... + bool ownedNewID = false; + NewID* newid = NULL; + if (!mgmtRequest->getTerminate()) { + // Better be a NewID in there. + newid = mgmtRequest->getNewID(); + if (!newid) { + // Check for NewEncryptedID. + NewEncryptedID* encnewid = mgmtRequest->getNewEncryptedID(); + if (encnewid) { + CredentialResolver* cr=application.getCredentialResolver(); + if (!cr) + m_log.warn("found encrypted NewID, but no decryption credential was available"); + else { + Locker credlocker(cr); + auto_ptr mcc( + policy.getIssuerMetadata() ? new MetadataCredentialCriteria(*policy.getIssuerMetadata()) : NULL + ); + try { + auto_ptr decryptedID(encnewid->decrypt(*cr,application.getRelyingParty(entity)->getXMLString("entityID").second,mcc.get())); + newid = dynamic_cast(decryptedID.get()); + if (newid) { + ownedNewID = true; + decryptedID.release(); + } + } + catch (exception& ex) { + m_log.error(ex.what()); + } + } + } + } + + if (!newid) { + // No NewID, so must respond with an error. + m_log.error("NewID not found in request"); + return sendResponse( + mgmtRequest->getID(), + StatusCode::REQUESTER, NULL, "NewID not found in request.", + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + m_decoder->isUserAgentPresent() + ); + } + } + + auto_ptr newwrapper(ownedNewID ? newid : NULL); + + // TODO: maybe support in-place modification of sessions? + /* + vector sessions; + try { + time_t expires = logoutRequest->getNotOnOrAfter() ? logoutRequest->getNotOnOrAfterEpoch() : 0; + cache->logout(entity, *nameid, &indexes, expires, application, sessions); + + // Now we actually terminate everything except for the active session, + // if this is front-channel, for notification purposes. + for (vector::const_iterator sit = sessions.begin(); sit != sessions.end(); ++sit) + if (session_id && strcmp(sit->c_str(), session_id)) + cache->remove(sit->c_str(), application); + } + catch (exception& ex) { + m_log.error("error while logging out matching sessions: %s", ex.what()); + return sendResponse( + logoutRequest->getID(), + StatusCode::RESPONDER, NULL, ex.what(), + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + m_decoder->isUserAgentPresent() + ); + } + */ + + // Do back-channel app notifications. + // Not supporting front-channel due to privacy fears. + bool worked = notifyBackChannel(application, request.getRequestURL(), *nameid, newid); + + return sendResponse( + mgmtRequest->getID(), + worked ? StatusCode::SUCCESS : StatusCode::RESPONDER, + NULL, + NULL, + relayState.c_str(), + policy.getIssuerMetadata(), + application, + response, + m_decoder->isUserAgentPresent() + ); + } + + // A ManageNameIDResponse completes an SP-initiated sequence, currently not supported. + /* + const ManageNameIDResponse* mgmtResponse = dynamic_cast(msg.get()); + if (mgmtResponse) { + if (!policy.isAuthenticated()) { + SecurityPolicyException ex("Security of ManageNameIDResponse not established."); + if (policy.getIssuerMetadata()) + annotateException(&ex, policy.getIssuerMetadata()); // throws it + ex.raise(); + } + checkError(mgmtResponse, policy.getIssuerMetadata()); // throws if Status doesn't look good... + + // Return template for completion. + return sendLogoutPage(application, response, false, "Global logout completed."); + } + */ + + FatalProfileException ex("Incoming message was not a samlp:ManageNameIDRequest."); + if (policy.getIssuerMetadata()) + annotateException(&ex, policy.getIssuerMetadata()); // throws it + ex.raise(); + return make_pair(false,0L); // never happen, satisfies compiler +#else + throw ConfigurationException("Cannot process NameID mgmt message using lite version of shibsp library."); +#endif +} + +#ifndef SHIBSP_LITE + +pair SAML2NameIDMgmt::sendResponse( + const XMLCh* requestID, + const XMLCh* code, + const XMLCh* subcode, + const char* msg, + const char* relayState, + const RoleDescriptor* role, + const Application& application, + HTTPResponse& httpResponse, + bool front + ) const +{ + // Get endpoint and encoder to use. + const EndpointType* ep = NULL; + const MessageEncoder* encoder = NULL; + if (front) { + const IDPSSODescriptor* idp = dynamic_cast(role); + for (vector::const_iterator b = m_bindings.begin(); idp && b!=m_bindings.end(); ++b) { + if (ep=EndpointManager(idp->getManageNameIDServices()).getByBinding(*b)) { + map::const_iterator enc = m_encoders.find(*b); + if (enc!=m_encoders.end()) + encoder = enc->second; + break; + } + } + if (!ep || !encoder) { + auto_ptr_char id(dynamic_cast(role->getParent())->getEntityID()); + m_log.error("unable to locate compatible NIM service for provider (%s)", id.get()); + MetadataException ex("Unable to locate endpoint at IdP ($entityID) to send ManageNameIDResponse."); + annotateException(&ex, role); // throws it + } + } + else { + encoder = m_encoders.begin()->second; + } + + // Prepare response. + auto_ptr nim(ManageNameIDResponseBuilder::buildManageNameIDResponse()); + nim->setInResponseTo(requestID); + if (ep) { + const XMLCh* loc = ep->getResponseLocation(); + if (!loc || !*loc) + loc = ep->getLocation(); + nim->setDestination(loc); + } + Issuer* issuer = IssuerBuilder::buildIssuer(); + nim->setIssuer(issuer); + issuer->setName(application.getRelyingParty(dynamic_cast(role->getParent()))->getXMLString("entityID").second); + fillStatus(*nim.get(), code, subcode, msg); + + auto_ptr_char dest(nim->getDestination()); + + long ret = sendMessage(*encoder, nim.get(), relayState, dest.get(), role, application, httpResponse); + nim.release(); // freed by encoder + return make_pair(true,ret); +} + +#include "util/SPConstants.h" +#include +#include +#include +using namespace soap11; +namespace { + static const XMLCh NameIDNotification[] = UNICODE_LITERAL_18(N,a,m,e,I,D,N,o,t,i,f,i,c,a,t,i,o,n); + + class SHIBSP_DLLLOCAL SOAPNotifier : public soap11::SOAPClient + { + public: + SOAPNotifier() {} + virtual ~SOAPNotifier() {} + private: + void prepareTransport(SOAPTransport& transport) { + transport.setVerifyHost(false); + } + }; +}; + +bool SAML2NameIDMgmt::notifyBackChannel( + const Application& application, const char* requestURL, const NameID& nameid, const NewID* newid + ) const +{ + unsigned int index = 0; + string endpoint = application.getNotificationURL(requestURL, false, index++); + if (endpoint.empty()) + return true; + + auto_ptr env(EnvelopeBuilder::buildEnvelope()); + Body* body = BodyBuilder::buildBody(); + env->setBody(body); + ElementProxy* msg = new AnyElementImpl(shibspconstants::SHIB2SPNOTIFY_NS, NameIDNotification); + body->getUnknownXMLObjects().push_back(msg); + msg->getUnknownXMLObjects().push_back(nameid.clone()); + if (newid) + msg->getUnknownXMLObjects().push_back(newid->clone()); + else + msg->getUnknownXMLObjects().push_back(TerminateBuilder::buildTerminate()); + + bool result = true; + SOAPNotifier soaper; + while (!endpoint.empty()) { + try { + soaper.send(*env.get(), SOAPTransport::Address(application.getId(), application.getId(), endpoint.c_str())); + delete soaper.receive(); + } + catch (exception& ex) { + m_log.error("error notifying application of logout event: %s", ex.what()); + result = false; + } + soaper.reset(); + endpoint = application.getNotificationURL(requestURL, false, index++); + } + return result; +} + +#endif diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp new file mode 100644 index 0000000..9906907 --- /dev/null +++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp @@ -0,0 +1,650 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAML2SessionInitiator.cpp + * + * SAML 2.0 AuthnRequest support. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" +#include "handler/SessionInitiator.h" +#include "util/SPConstants.h" + +#ifndef SHIBSP_LITE +# include +# include +# include +# include +# include +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +#else +#include +#endif + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL SAML2SessionInitiator : public SessionInitiator, public AbstractHandler, public RemotedHandler + { + public: + SAML2SessionInitiator(const DOMElement* e, const char* appId); + virtual ~SAML2SessionInitiator() { +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + XMLString::release(&m_outgoing); + for_each(m_encoders.begin(), m_encoders.end(), cleanup_pair()); + delete m_requestTemplate; + } +#endif + } + + void setParent(const PropertySet* parent); + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + + private: + pair doRequest( + const Application& application, + HTTPResponse& httpResponse, + const char* entityID, + const XMLCh* acsIndex, + const char* acsLocation, + const XMLCh* acsBinding, + bool isPassive, + bool forceAuthn, + const char* authnContextClassRef, + const char* authnContextComparison, + string& relayState + ) const; + + string m_appId; + auto_ptr_char m_paosNS,m_ecpNS; + auto_ptr_XMLCh m_paosBinding; +#ifndef SHIBSP_LITE + XMLCh* m_outgoing; + vector m_bindings; + map m_encoders; + MessageEncoder* m_ecp; + AuthnRequest* m_requestTemplate; +#else + bool m_ecp; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* SHIBSP_DLLLOCAL SAML2SessionInitiatorFactory(const pair& p) + { + return new SAML2SessionInitiator(p.first, p.second); + } + +}; + +SAML2SessionInitiator::SAML2SessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.SAML2")), m_appId(appId), + m_paosNS(samlconstants::PAOS_NS), m_ecpNS(samlconstants::SAML20ECP_NS), m_paosBinding(samlconstants::SAML20_BINDING_PAOS) +{ + static const XMLCh ECP[] = UNICODE_LITERAL_3(E,C,P); + const XMLCh* flag = e ? e->getAttributeNS(NULL,ECP) : NULL; +#ifdef SHIBSP_LITE + m_ecp = (flag && (*flag == chLatin_t || *flag == chDigit_1)); +#else + m_outgoing=NULL; + m_ecp = NULL; + m_requestTemplate=NULL; + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + // Check for a template AuthnRequest to build from. + DOMElement* child = XMLHelper::getFirstChildElement(e, samlconstants::SAML20P_NS, AuthnRequest::LOCAL_NAME); + if (child) + m_requestTemplate = dynamic_cast(AuthnRequestBuilder::buildOneFromElement(child)); + + // If directed, build an ECP encoder. + if (flag && (*flag == chLatin_t || *flag == chDigit_1)) { + try { + m_ecp = SAMLConfig::getConfig().MessageEncoderManager.newPlugin( + samlconstants::SAML20_BINDING_PAOS, pair(e,NULL) + ); + } + catch (exception& ex) { + m_log.error("error building PAOS/ECP MessageEncoder: %s", ex.what()); + } + } + + // Handle outgoing binding setup. + pair outgoing = getXMLString("outgoingBindings"); + if (outgoing.first) { + m_outgoing = XMLString::replicate(outgoing.second); + XMLString::trim(m_outgoing); + } + else { + // No override, so we'll install a default binding precedence. + string prec = string(samlconstants::SAML20_BINDING_HTTP_REDIRECT) + ' ' + samlconstants::SAML20_BINDING_HTTP_POST + ' ' + + samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN + ' ' + samlconstants::SAML20_BINDING_HTTP_ARTIFACT; + m_outgoing = XMLString::transcode(prec.c_str()); + } + + int pos; + XMLCh* start = m_outgoing; + while (start && *start) { + pos = XMLString::indexOf(start,chSpace); + if (pos != -1) + *(start + pos)=chNull; + m_bindings.push_back(start); + try { + auto_ptr_char b(start); + MessageEncoder * encoder = SAMLConfig::getConfig().MessageEncoderManager.newPlugin( + b.get(),pair(e,NULL) + ); + m_encoders[start] = encoder; + m_log.debug("supporting outgoing binding (%s)", b.get()); + } + catch (exception& ex) { + m_log.error("error building MessageEncoder: %s", ex.what()); + } + if (pos != -1) + start = start + pos + 1; + else + break; + } + } +#endif + + // If Location isn't set, defer address registration until the setParent call. + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::SAML2SI"; + setAddress(address.c_str()); + } +} + +void SAML2SessionInitiator::setParent(const PropertySet* parent) +{ + DOMPropertySet::setParent(parent); + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::SAML2SI"; + setAddress(address.c_str()); + } + else { + m_log.warn("no Location property in SAML2 SessionInitiator (or parent), can't register as remoted handler"); + } +} + +pair SAML2SessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + // First check for ECP support, since that doesn't require an IdP to be known. + bool ECP = false; + if (m_ecp && request.getHeader("Accept").find("application/vnd.paos+xml") != string::npos) { + string PAOS = request.getHeader("PAOS"); + if (PAOS.find(m_paosNS.get()) != string::npos && PAOS.find(m_ecpNS.get()) != string::npos) + ECP = true; + } + + // We have to know the IdP to function unless this is ECP. + if (!ECP && (entityID.empty())) + return make_pair(false,0L); + + string target; + const Handler* ACS=NULL; + const char* option; + pair acClass; + pair acComp; + bool isPassive=false,forceAuthn=false; + const Application& app=request.getApplication(); + + // ECP means the ACS will be by value no matter what. + pair acsByIndex = ECP ? make_pair(true,false) : getBool("acsByIndex"); + + if (isHandler) { + option=request.getParameter("acsIndex"); + if (option) { + ACS = app.getAssertionConsumerServiceByIndex(atoi(option)); + if (!ACS) + request.log(SPRequest::SPWarn, "invalid acsIndex specified in request, using default ACS location"); + else if (ECP && !XMLString::equals(ACS->getString("Binding").second, samlconstants::SAML20_BINDING_PAOS)) { + request.log(SPRequest::SPWarn, "acsIndex in request referenced a non-PAOS ACS, using default ACS location"); + ACS = NULL; + } + } + + option = request.getParameter("target"); + if (option) + target = option; + if (acsByIndex.first && !acsByIndex.second) { + // Since we're passing the ACS by value, we need to compute the return URL, + // so we'll need the target resource for real. + recoverRelayState(request.getApplication(), request, request, target, false); + } + + pair flag; + option = request.getParameter("isPassive"); + if (option) { + isPassive = (*option=='1' || *option=='t'); + } + else { + flag = getBool("isPassive"); + isPassive = (flag.first && flag.second); + } + if (!isPassive) { + option = request.getParameter("forceAuthn"); + if (option) { + forceAuthn = (*option=='1' || *option=='t'); + } + else { + flag = getBool("forceAuthn"); + forceAuthn = (flag.first && flag.second); + } + } + + if (acClass.second = request.getParameter("authnContextClassRef")) + acClass.first = true; + else + acClass = getString("authnContextClassRef"); + + if (acComp.second = request.getParameter("authnContextComparison")) + acComp.first = true; + else + acComp = getString("authnContextComparison"); + } + else { + // We're running as a "virtual handler" from within the filter. + // The target resource is the current one and everything else is defaulted. + target=request.getRequestURL(); + const PropertySet* settings = request.getRequestSettings().first; + + pair flag = settings->getBool("isPassive"); + if (!flag.first) + flag = getBool("isPassive"); + isPassive = flag.first && flag.second; + if (!isPassive) { + flag = settings->getBool("forceAuthn"); + if (!flag.first) + flag = getBool("forceAuthn"); + forceAuthn = flag.first && flag.second; + } + + acClass = settings->getString("authnContextClassRef"); + if (!acClass.first) + acClass = getString("authnContextClassRef"); + acComp = settings->getString("authnContextComparison"); + if (!acComp.first) + acComp = getString("authnContextComparison"); + } + + if (ECP) + m_log.debug("attempting to initiate session using SAML 2.0 Enhanced Client Profile"); + else + m_log.debug("attempting to initiate session using SAML 2.0 with provider (%s)", entityID.c_str()); + + if (!ACS) { + if (ECP) { + const vector& handlers = app.getAssertionConsumerServicesByBinding(m_paosBinding.get()); + if (handlers.empty()) + throw ConfigurationException("Unable to locate PAOS response endpoint."); + ACS = handlers.front(); + } + else { + pair index = getUnsignedInt("defaultACSIndex"); + if (index.first) { + ACS = app.getAssertionConsumerServiceByIndex(index.second); + if (!ACS) + request.log(SPRequest::SPWarn, "invalid defaultACSIndex, using default ACS location"); + } + if (!ACS) + ACS = app.getDefaultAssertionConsumerService(); + } + } + + // To invoke the request builder, the key requirement is to figure out how + // to express the ACS, by index or value, and if by value, where. + // We have to compute the handlerURL no matter what, because we may need to + // flip the index to an SSL-version. + string ACSloc=request.getHandlerURL(target.c_str()); + + SPConfig& conf = SPConfig::getConfig(); + if (conf.isEnabled(SPConfig::OutOfProcess)) { + if (!acsByIndex.first || acsByIndex.second) { + // Pass by Index. + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + target.erase(); + option = request.getParameter("target"); + if (option) + target = option; + } + + // Determine index to use. + pair ix = pair(false,NULL); + if (ACS) { + if (!strncmp(ACSloc.c_str(), "https", 5)) { + ix = ACS->getXMLString("sslIndex", shibspconstants::ASCII_SHIB2SPCONFIG_NS); + if (!ix.first) + ix = ACS->getXMLString("index"); + } + else { + ix = ACS->getXMLString("index"); + } + } + + return doRequest( + app, request, entityID.c_str(), + ix.second, NULL, NULL, + isPassive, forceAuthn, + acClass.first ? acClass.second : NULL, + acComp.first ? acComp.second : NULL, + target + ); + } + + // Since we're not passing by index, we need to fully compute the return URL and binding. + // Compute the ACS URL. We add the ACS location to the base handlerURL. + pair loc=ACS ? ACS->getString("Location") : pair(false,NULL); + if (loc.first) ACSloc+=loc.second; + + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + target.erase(); + option = request.getParameter("target"); + if (option) + target = option; + } + + return doRequest( + app, request, entityID.c_str(), + NULL, ACSloc.c_str(), ACS ? ACS->getXMLString("Binding").second : NULL, + isPassive, forceAuthn, + acClass.first ? acClass.second : NULL, + acComp.first ? acComp.second : NULL, + target + ); + } + + // Remote the call. + DDF out,in = DDF(m_address.c_str()).structure(); + DDFJanitor jin(in), jout(out); + in.addmember("application_id").string(app.getId()); + if (!entityID.empty()) + in.addmember("entity_id").string(entityID.c_str()); + if (isPassive) + in.addmember("isPassive").integer(1); + else if (forceAuthn) + in.addmember("forceAuthn").integer(1); + if (acClass.first) + in.addmember("authnContextClassRef").string(acClass.second); + if (acComp.first) + in.addmember("authnContextComparison").string(acComp.second); + if (!acsByIndex.first || acsByIndex.second) { + if (ACS) { + // Determine index to use. + pair ix = pair(false,NULL); + if (!strncmp(ACSloc.c_str(), "https", 5)) { + ix = ACS->getString("sslIndex", shibspconstants::ASCII_SHIB2SPCONFIG_NS); + if (!ix.first) + ix = ACS->getString("index"); + } + else { + ix = ACS->getString("index"); + } + in.addmember("acsIndex").string(ix.second); + } + } + else { + // Since we're not passing by index, we need to fully compute the return URL and binding. + // Compute the ACS URL. We add the ACS location to the base handlerURL. + pair loc=ACS ? ACS->getString("Location") : pair(false,NULL); + if (loc.first) ACSloc+=loc.second; + in.addmember("acsLocation").string(ACSloc.c_str()); + if (ACS) + in.addmember("acsBinding").string(ACS->getString("Binding").second); + } + + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + target.erase(); + option = request.getParameter("target"); + if (option) + target = option; + } + if (!target.empty()) + in.addmember("RelayState").string(target.c_str()); + + // Remote the processing. + out = request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); +} + +void SAML2SessionInitiator::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) to generate AuthnRequest", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for new session, deleted?"); + } + + DDF ret(NULL); + DDFJanitor jout(ret); + + // Wrap the outgoing object with a Response facade. + auto_ptr http(getResponse(ret)); + + auto_ptr_XMLCh index(in["acsIndex"].string()); + auto_ptr_XMLCh bind(in["acsBinding"].string()); + + string relayState(in["RelayState"].string() ? in["RelayState"].string() : ""); + + // Since we're remoted, the result should either be a throw, which we pass on, + // a false/0 return, which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + doRequest( + *app, *http.get(), in["entity_id"].string(), + index.get(), in["acsLocation"].string(), bind.get(), + in["isPassive"].integer()==1, in["forceAuthn"].integer()==1, + in["authnContextClassRef"].string(), in["authnContextComparison"].string(), + relayState + ); + out << ret; +} + +#ifndef SHIBSP_LITE +namespace { + class _sameIdP : public binary_function + { + public: + bool operator()(const IDPEntry* entry, const XMLCh* entityID) const { + return entry ? XMLString::equals(entry->getProviderID(), entityID) : false; + } + }; +}; +#endif + +pair SAML2SessionInitiator::doRequest( + const Application& app, + HTTPResponse& httpResponse, + const char* entityID, + const XMLCh* acsIndex, + const char* acsLocation, + const XMLCh* acsBinding, + bool isPassive, + bool forceAuthn, + const char* authnContextClassRef, + const char* authnContextComparison, + string& relayState + ) const +{ +#ifndef SHIBSP_LITE + bool ECP = XMLString::equals(acsBinding, m_paosBinding.get()); + + pair entity = pair(NULL,NULL); + const IDPSSODescriptor* role = NULL; + const EndpointType* ep = NULL; + const MessageEncoder* encoder = NULL; + + // We won't need this for ECP, but safety dictates we get the lock here. + MetadataProvider* m=app.getMetadataProvider(); + Locker locker(m); + + if (ECP) { + encoder = m_ecp; + if (!encoder) { + m_log.error("MessageEncoder for PAOS binding not available"); + return make_pair(false,0L); + } + } + else { + // Use metadata to locate the IdP's SSO service. + MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS); + entity=m->getEntityDescriptor(mc); + if (!entity.first) { + m_log.warn("unable to locate metadata for provider (%s)", entityID); + throw MetadataException("Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", entityID)); + } + else if (!entity.second) { + m_log.warn("unable to locate SAML 2.0 identity provider role for provider (%s)", entityID); + if (getParent()) + return make_pair(false,0L); + throw MetadataException("Unable to locate SAML 2.0 identity provider role for provider ($entityID)", namedparams(1, "entityID", entityID)); + } + + // Loop over the supportable outgoing bindings. + role = dynamic_cast(entity.second); + vector::const_iterator b; + for (b = m_bindings.begin(); b!=m_bindings.end(); ++b) { + if (ep=EndpointManager(role->getSingleSignOnServices()).getByBinding(*b)) { + map::const_iterator enc = m_encoders.find(*b); + if (enc!=m_encoders.end()) + encoder = enc->second; + break; + } + } + if (!ep || !encoder) { + m_log.warn("unable to locate compatible SSO service for provider (%s)", entityID); + if (getParent()) + return make_pair(false,0L); + throw MetadataException("Unable to locate compatible SSO service for provider ($entityID)", namedparams(1, "entityID", entityID)); + } + } + + preserveRelayState(app, httpResponse, relayState); + + auto_ptr req(m_requestTemplate ? m_requestTemplate->cloneAuthnRequest() : AuthnRequestBuilder::buildAuthnRequest()); + if (m_requestTemplate) { + // Freshen TS and ID. + req->setID(NULL); + req->setIssueInstant(time(NULL)); + } + + if (ep) + req->setDestination(ep->getLocation()); + if (acsIndex && *acsIndex) + req->setAssertionConsumerServiceIndex(acsIndex); + if (acsLocation) { + auto_ptr_XMLCh wideloc(acsLocation); + req->setAssertionConsumerServiceURL(wideloc.get()); + } + if (acsBinding && *acsBinding) + req->setProtocolBinding(acsBinding); + if (isPassive) + req->IsPassive(isPassive); + else if (forceAuthn) + req->ForceAuthn(forceAuthn); + if (!req->getIssuer()) { + Issuer* issuer = IssuerBuilder::buildIssuer(); + req->setIssuer(issuer); + issuer->setName(app.getRelyingParty(entity.first)->getXMLString("entityID").second); + } + if (!req->getNameIDPolicy()) { + NameIDPolicy* namepol = NameIDPolicyBuilder::buildNameIDPolicy(); + req->setNameIDPolicy(namepol); + namepol->AllowCreate(true); + } + if (authnContextClassRef || authnContextComparison) { + RequestedAuthnContext* reqContext = req->getRequestedAuthnContext(); + if (!reqContext) { + reqContext = RequestedAuthnContextBuilder::buildRequestedAuthnContext(); + req->setRequestedAuthnContext(reqContext); + } + if (authnContextClassRef) { + reqContext->getAuthnContextDeclRefs().clear(); + auto_ptr_XMLCh wideclass(authnContextClassRef); + AuthnContextClassRef* cref = AuthnContextClassRefBuilder::buildAuthnContextClassRef(); + cref->setReference(wideclass.get()); + reqContext->getAuthnContextClassRefs().push_back(cref); + } + if (authnContextComparison && + (!reqContext->getAuthnContextClassRefs().empty() || !reqContext->getAuthnContextDeclRefs().empty())) { + auto_ptr_XMLCh widecomp(authnContextComparison); + reqContext->setComparison(widecomp.get()); + } + } + + if (ECP && entityID) { + auto_ptr_XMLCh wideid(entityID); + Scoping* scoping = req->getScoping(); + if (!scoping) { + scoping = ScopingBuilder::buildScoping(); + req->setScoping(scoping); + } + IDPList* idplist = scoping->getIDPList(); + if (!idplist) { + idplist = IDPListBuilder::buildIDPList(); + scoping->setIDPList(idplist); + } + VectorOf(IDPEntry) entries = idplist->getIDPEntrys(); + if (find_if(entries, bind2nd(_sameIdP(), wideid.get())) == NULL) { + IDPEntry* entry = IDPEntryBuilder::buildIDPEntry(); + entry->setProviderID(wideid.get()); + entries.push_back(entry); + } + } + + auto_ptr_char dest(ep ? ep->getLocation() : NULL); + + long ret = sendMessage( + *encoder, req.get(), relayState.c_str(), dest.get(), role, app, httpResponse, role ? role->WantAuthnRequestsSigned() : false + ); + req.release(); // freed by encoder + return make_pair(true,ret); +#else + return make_pair(false,0L); +#endif +} diff --git a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp new file mode 100644 index 0000000..90d189c --- /dev/null +++ b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp @@ -0,0 +1,221 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAMLDSSessionInitiator.cpp + * + * SAML Discovery Service support. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/SessionInitiator.h" + +#include +#include +#include + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +#ifndef SHIBSP_LITE +using namespace opensaml::saml2md; +#endif + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL SAMLDSSessionInitiator : public SessionInitiator, public AbstractHandler + { + public: + SAMLDSSessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.SAMLDS")), m_url(NULL), m_returnParam(NULL) +#ifndef SHIBSP_LITE + ,m_discoNS("urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol") +#endif + { + pair url = getString("URL"); + if (!url.first) + throw ConfigurationException("SAMLDS SessionInitiator requires a URL property."); + m_url = url.second; + url = getString("entityIDParam"); + if (url.first) + m_returnParam = url.second; + } + virtual ~SAMLDSSessionInitiator() {} + + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + +#ifndef SHIBSP_LITE + void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const { + static const XMLCh LOCAL_NAME[] = UNICODE_LITERAL_17(D,i,s,c,o,v,e,r,y,R,e,s,p,o,n,s,e); + const char* loc = getString("Location").second; + string hurl(handlerURL); + if (*loc != '/') + hurl += '/'; + hurl += loc; + auto_ptr_XMLCh widen(hurl.c_str()); + ElementProxy* ep = new AnyElementImpl(m_discoNS.get(), LOCAL_NAME); + ep->setAttribute(QName(NULL,EndpointType::LOCATION_ATTRIB_NAME), widen.get()); + ep->setAttribute(QName(NULL,EndpointType::BINDING_ATTRIB_NAME), getXMLString("Binding").second); + pair ix = getXMLString("index"); + ep->setAttribute(QName(NULL,IndexedEndpointType::INDEX_ATTRIB_NAME), ix.first ? ix.second : xmlconstants::XML_ONE); + + Extensions* ext = role.getExtensions(); + if (!ext) { + ext = ExtensionsBuilder::buildExtensions(); + role.setExtensions(ext); + } + ext->getUnknownXMLObjects().push_back(ep); + } +#endif + + private: + const char* m_url; + const char* m_returnParam; +#ifndef SHIBSP_LITE + auto_ptr_XMLCh m_discoNS; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* SHIBSP_DLLLOCAL SAMLDSSessionInitiatorFactory(const pair& p) + { + return new SAMLDSSessionInitiator(p.first, p.second); + } + +}; + +pair SAMLDSSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + // The IdP CANNOT be specified for us to run. Otherwise, we'd be redirecting to a DS + // anytime the IdP's metadata was wrong. + if (!entityID.empty()) + return make_pair(false,0L); + + string target; + const char* option; + bool isPassive=false; + const Application& app=request.getApplication(); + + if (isHandler) { + option = request.getParameter("SAMLDS"); + if (option && !strcmp(option,"1")) { + saml2md::MetadataException ex("No identity provider was selected by user."); + ex.addProperty("statusCode", "urn:oasis:names:tc:SAML:2.0:status:Requester"); + ex.addProperty("statusCode2", "urn:oasis:names:tc:SAML:2.0:status:NoAvailableIDP"); + ex.raise(); + } + + option = request.getParameter("target"); + if (option) + target = option; + recoverRelayState(request.getApplication(), request, request, target, false); + + option = request.getParameter("isPassive"); + if (option) + isPassive = !strcmp(option,"true"); + } + else { + // We're running as a "virtual handler" from within the filter. + // The target resource is the current one and everything else is + // defaulted or set by content policy. + target=request.getRequestURL(); + pair passopt = getBool("isPassive"); + isPassive = passopt.first && passopt.second; + } + + m_log.debug("sending request to SAMLDS (%s)", m_url); + + // Compute the return URL. We start with a self-referential link. + string returnURL=request.getHandlerURL(target.c_str()); + pair thisloc = getString("Location"); + if (thisloc.first) returnURL += thisloc.second; + returnURL += "?SAMLDS=1"; // signals us not to loop if we get no answer back + + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + option = request.getParameter("target"); + if (option) + target = option; + } + preserveRelayState(request.getApplication(), request, target); + + const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder(); + if (isHandler) { + // Now the hard part. The base assumption is to append the entire query string, if any, + // to the self-link. But we want to replace target with the RelayState-preserved value + // to hide it from the DS. + const char* query = request.getQueryString(); + if (query) { + // See if it starts with target. + if (!strncmp(query, "target=", 7)) { + // We skip this altogether and advance the query past it to the first separator. + query = strchr(query, '&'); + // If we still have more, just append it. + if (query && *(++query)) + returnURL = returnURL + '&' + query; + } + else { + // There's something in the query before target appears, so we have to find it. + thisloc.second = strstr(query,"&target="); + if (thisloc.second) { + // We found it, so first append everything up to it. + returnURL += '&'; + returnURL.append(query, thisloc.second - query); + query = thisloc.second + 8; // move up just past the equals sign. + thisloc.second = strchr(query, '&'); + if (thisloc.second) + returnURL += thisloc.second; + } + else { + // No target in the existing query, so just append it as is. + returnURL = returnURL + '&' + query; + } + } + } + + // Now append the sanitized target as needed. + if (!target.empty()) + returnURL = returnURL + "&target=" + urlenc->encode(target.c_str()); + } + else if (!target.empty()) { + // For a virtual handler, we just append target to the return link. + returnURL = returnURL + "&target=" + urlenc->encode(target.c_str());; + } + + string req=string(m_url) + (strchr(m_url,'?') ? '&' : '?') + "entityID=" + urlenc->encode(app.getString("entityID").second) + + "&return=" + urlenc->encode(returnURL.c_str()); + if (m_returnParam) + req = req + "&returnIDParam=" + m_returnParam; + if (isPassive) + req += "&isPassive=true"; + + return make_pair(true, request.sendRedirect(req.c_str())); +} diff --git a/shibsp/handler/impl/SessionHandler.cpp b/shibsp/handler/impl/SessionHandler.cpp new file mode 100644 index 0000000..ff5939b --- /dev/null +++ b/shibsp/handler/impl/SessionHandler.cpp @@ -0,0 +1,195 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SessionHandler.cpp + * + * Handler for dumping information about an active session. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "SPRequest.h" +#include "attribute/Attribute.h" +#include "handler/AbstractHandler.h" + +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + }; + + static SHIBSP_DLLLOCAL Blocker g_Blocker; + + class SHIBSP_API SessionHandler : public AbstractHandler + { + public: + SessionHandler(const DOMElement* e, const char* appId); + virtual ~SessionHandler() {} + + pair run(SPRequest& request, bool isHandler=true) const; + + private: + bool m_values; + set m_acl; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL SessionHandlerFactory(const pair& p) + { + return new SessionHandler(p.first, p.second); + } + +}; + +SessionHandler::SessionHandler(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionHandler"), &g_Blocker), m_values(false) +{ + pair acl = getString("acl"); + if (acl.first) { + string aclbuf=acl.second; + int j = 0; + for (unsigned int i=0; i < aclbuf.length(); i++) { + if (aclbuf.at(i)==' ') { + m_acl.insert(aclbuf.substr(j, i-j)); + j = i+1; + } + } + m_acl.insert(aclbuf.substr(j, aclbuf.length()-j)); + } + + pair flag = getBool("showAttributeValues"); + if (flag.first) + m_values = flag.second; +} + +pair SessionHandler::run(SPRequest& request, bool isHandler) const +{ + if (!m_acl.empty() && m_acl.count(request.getRemoteAddr()) == 0) { + m_log.error("session handler request blocked from invalid address (%s)", request.getRemoteAddr().c_str()); + istringstream msg("Session Handler Blocked"); + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_UNAUTHORIZED)); + } + + stringstream s; + s << "Session Summary

" << endl;
+
+    Session* session = NULL;
+    try {
+        session = request.getSession();
+        if (!session) {
+            s << "A valid session was not found.
" << endl; + request.setContentType("text/html"); + request.setResponseHeader("Expires","01-Jan-1997 12:00:00 GMT"); + request.setResponseHeader("Cache-Control","private,no-store,no-cache"); + return make_pair(true, request.sendResponse(s)); + } + } + catch (exception& ex) { + s << "Exception while retrieving active session:" << endl + << '\t' << ex.what() << "" << endl; + request.setContentType("text/html"); + request.setResponseHeader("Expires","01-Jan-1997 12:00:00 GMT"); + request.setResponseHeader("Cache-Control","private,no-store,no-cache"); + return make_pair(true, request.sendResponse(s)); + } + + s << "Miscellaneous" << endl; + + s << "Client Address: " << (session->getClientAddress() ? session->getClientAddress() : "(none)") << endl; + s << "Identity Provider: " << (session->getEntityID() ? session->getEntityID() : "(none)") << endl; + s << "SSO Protocol: " << (session->getProtocol() ? session->getProtocol() : "(none)") << endl; + s << "Authentication Time: " << (session->getAuthnInstant() ? session->getAuthnInstant() : "(none)") << endl; + s << "Authentication Context Class: " << (session->getAuthnContextClassRef() ? session->getAuthnContextClassRef() : "(none)") << endl; + s << "Authentication Context Decl: " << (session->getAuthnContextDeclRef() ? session->getAuthnContextDeclRef() : "(none)") << endl; + s << "Session Expiration (barring inactivity): "; + if (session->getExpiration()) + s << ((session->getExpiration() - time(NULL)) / 60) << " minute(s)" << endl; + else + s << "Infinite" << endl; + + s << endl << "Attributes" << endl; + + string key; + vector::size_type count=0; + const multimap& attributes = session->getIndexedAttributes(); + for (multimap::const_iterator a = attributes.begin(); a != attributes.end(); ++a) { + if (a->first != key) { + if (a != attributes.begin()) { + if (m_values) + s << endl; + else { + s << count << " value(s)" << endl; + count = 0; + } + } + s << "" << a->second->getId() << ": "; + } + + if (m_values) { + const vector& vals = a->second->getSerializedValues(); + for (vector::const_iterator v = vals.begin(); v!=vals.end(); ++v) { + if (v != vals.begin() || a->first == key) + s << ';'; + string::size_type pos = v->find_first_of(';',string::size_type(0)); + if (pos!=string::npos) { + string value(*v); + for (; pos != string::npos; pos = value.find_first_of(';',pos)) { + value.insert(pos, "\\"); + pos += 2; + } + s << value; + } + else { + s << *v; + } + } + } + else { + count += a->second->getSerializedValues().size(); + } + } + + if (!m_values && !attributes.empty()) + s << count << " value(s)" << endl; + + s << ""; + request.setContentType("text/html; charset=UTF-8"); + request.setResponseHeader("Expires","01-Jan-1997 12:00:00 GMT"); + request.setResponseHeader("Cache-Control","private,no-store,no-cache"); + return make_pair(true, request.sendResponse(s)); +} diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp new file mode 100644 index 0000000..acc194e --- /dev/null +++ b/shibsp/handler/impl/SessionInitiator.cpp @@ -0,0 +1,76 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SessionInitiator.cpp + * + * Pluggable runtime functionality that handles initiating sessions. + */ + +#include "internal.h" +#include "SPRequest.h" +#include "handler/SessionInitiator.h" + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory ChainingSessionInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory Shib1SessionInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory SAML2SessionInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory WAYFSessionInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory SAMLDSSessionInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory TransformSessionInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory FormSessionInitiatorFactory; + SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair >::Factory CookieSessionInitiatorFactory; +}; + +void SHIBSP_API shibsp::registerSessionInitiators() +{ + SPConfig& conf=SPConfig::getConfig(); + conf.SessionInitiatorManager.registerFactory(CHAINING_SESSION_INITIATOR, ChainingSessionInitiatorFactory); + conf.SessionInitiatorManager.registerFactory(SHIB1_SESSION_INITIATOR, Shib1SessionInitiatorFactory); + conf.SessionInitiatorManager.registerFactory(SAML2_SESSION_INITIATOR, SAML2SessionInitiatorFactory); + conf.SessionInitiatorManager.registerFactory(WAYF_SESSION_INITIATOR, WAYFSessionInitiatorFactory); + conf.SessionInitiatorManager.registerFactory(SAMLDS_SESSION_INITIATOR, SAMLDSSessionInitiatorFactory); + conf.SessionInitiatorManager.registerFactory(TRANSFORM_SESSION_INITIATOR, TransformSessionInitiatorFactory); + conf.SessionInitiatorManager.registerFactory(FORM_SESSION_INITIATOR, FormSessionInitiatorFactory); + conf.SessionInitiatorManager.registerFactory(COOKIE_SESSION_INITIATOR, CookieSessionInitiatorFactory); +} + +pair SessionInitiator::run(SPRequest& request, bool isHandler) const +{ + const char* entityID=NULL; + pair param = getString("entityIDParam"); + + if (isHandler) { + entityID=request.getParameter(param.first ? param.second : "entityID"); + if (!param.first && (!entityID || !*entityID)) + entityID=request.getParameter("providerId"); + } + if (!entityID || !*entityID) { + RequestMapper::Settings settings = request.getRequestSettings(); + param = settings.first->getString("entityID"); + if (param.first) + entityID = param.second; + } + if (!entityID || !*entityID) + entityID=getString("entityID").second; + + string copy(entityID ? entityID : ""); + return run(request, copy, isHandler); +} diff --git a/shibsp/handler/impl/Shib1SessionInitiator.cpp b/shibsp/handler/impl/Shib1SessionInitiator.cpp new file mode 100644 index 0000000..38fb2d3 --- /dev/null +++ b/shibsp/handler/impl/Shib1SessionInitiator.cpp @@ -0,0 +1,267 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Shib1SessionInitiator.cpp + * + * Shibboleth 1.x AuthnRequest support. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" +#include "handler/SessionInitiator.h" +#include "util/SPConstants.h" + +#ifndef SHIBSP_LITE +# include +# include +#endif +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL Shib1SessionInitiator : public SessionInitiator, public AbstractHandler, public RemotedHandler + { + public: + Shib1SessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.Shib1")), m_appId(appId) { + // If Location isn't set, defer address registration until the setParent call. + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::Shib1SI"; + setAddress(address.c_str()); + } + } + virtual ~Shib1SessionInitiator() {} + + void setParent(const PropertySet* parent); + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + + private: + pair doRequest( + const Application& application, + HTTPResponse& httpResponse, + const char* entityID, + const char* acsLocation, + string& relayState + ) const; + string m_appId; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* SHIBSP_DLLLOCAL Shib1SessionInitiatorFactory(const pair& p) + { + return new Shib1SessionInitiator(p.first, p.second); + } + +}; + +void Shib1SessionInitiator::setParent(const PropertySet* parent) +{ + DOMPropertySet::setParent(parent); + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::Shib1SI"; + setAddress(address.c_str()); + } + else { + m_log.warn("no Location property in Shib1 SessionInitiator (or parent), can't register as remoted handler"); + } +} + +pair Shib1SessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + // We have to know the IdP to function. + if (entityID.empty()) + return make_pair(false,0L); + + string target; + const Handler* ACS=NULL; + const char* option; + const Application& app=request.getApplication(); + + if (isHandler) { + option=request.getParameter("acsIndex"); + if (option) { + ACS = app.getAssertionConsumerServiceByIndex(atoi(option)); + if (!ACS) + request.log(SPRequest::SPWarn, "invalid acsIndex specified in request, using default ACS location"); + } + + option = request.getParameter("target"); + if (option) + target = option; + + // Since we're passing the ACS by value, we need to compute the return URL, + // so we'll need the target resource for real. + recoverRelayState(request.getApplication(), request, request, target, false); + } + else { + // We're running as a "virtual handler" from within the filter. + // The target resource is the current one and everything else is defaulted. + target=request.getRequestURL(); + } + + // Since we're not passing by index, we need to fully compute the return URL. + if (!ACS) { + pair index = getUnsignedInt("defaultACSIndex"); + if (index.first) { + ACS = app.getAssertionConsumerServiceByIndex(index.second); + if (!ACS) + request.log(SPRequest::SPWarn, "invalid defaultACSIndex, using default ACS location"); + } + if (!ACS) + ACS = app.getDefaultAssertionConsumerService(); + } + + // Compute the ACS URL. We add the ACS location to the base handlerURL. + string ACSloc=request.getHandlerURL(target.c_str()); + pair loc=ACS ? ACS->getString("Location") : pair(false,NULL); + if (loc.first) ACSloc+=loc.second; + + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + target.erase(); + option = request.getParameter("target"); + if (option) + target = option; + } + + m_log.debug("attempting to initiate session using Shibboleth with provider (%s)", entityID.c_str()); + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) + return doRequest(app, request, entityID.c_str(), ACSloc.c_str(), target); + + // Remote the call. + DDF out,in = DDF(m_address.c_str()).structure(); + DDFJanitor jin(in), jout(out); + in.addmember("application_id").string(app.getId()); + in.addmember("entity_id").string(entityID.c_str()); + in.addmember("acsLocation").string(ACSloc.c_str()); + if (!target.empty()) + in.addmember("RelayState").string(target.c_str()); + + // Remote the processing. + out = request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); +} + +void Shib1SessionInitiator::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) to generate AuthnRequest", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for new session, deleted?"); + } + + const char* entityID = in["entity_id"].string(); + const char* acsLocation = in["acsLocation"].string(); + if (!entityID || !acsLocation) + throw ConfigurationException("No entityID or acsLocation parameter supplied to remoted SessionInitiator."); + + DDF ret(NULL); + DDFJanitor jout(ret); + + // Wrap the outgoing object with a Response facade. + auto_ptr http(getResponse(ret)); + + string relayState(in["RelayState"].string() ? in["RelayState"].string() : ""); + + // Since we're remoted, the result should either be a throw, which we pass on, + // a false/0 return, which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + doRequest(*app, *http.get(), entityID, acsLocation, relayState); + out << ret; +} + +pair Shib1SessionInitiator::doRequest( + const Application& app, + HTTPResponse& httpResponse, + const char* entityID, + const char* acsLocation, + string& relayState + ) const +{ +#ifndef SHIBSP_LITE + // Use metadata to invoke the SSO service directly. + MetadataProvider* m=app.getMetadataProvider(); + Locker locker(m); + MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, shibspconstants::SHIB1_PROTOCOL_ENUM); + pair entity = m->getEntityDescriptor(mc); + if (!entity.first) { + m_log.warn("unable to locate metadata for provider (%s)", entityID); + throw MetadataException("Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", entityID)); + } + else if (!entity.second) { + m_log.warn("unable to locate Shibboleth-aware identity provider role for provider (%s)", entityID); + if (getParent()) + return make_pair(false,0L); + throw MetadataException("Unable to locate Shibboleth-aware identity provider role for provider ($entityID)", namedparams(1, "entityID", entityID)); + } + const EndpointType* ep=EndpointManager( + dynamic_cast(entity.second)->getSingleSignOnServices() + ).getByBinding(shibspconstants::SHIB1_AUTHNREQUEST_PROFILE_URI); + if (!ep) { + m_log.warn("unable to locate compatible SSO service for provider (%s)", entityID); + if (getParent()) + return make_pair(false,0L); + throw MetadataException("Unable to locate compatible SSO service for provider ($entityID)", namedparams(1, "entityID", entityID)); + } + + preserveRelayState(app, httpResponse, relayState); + + // Shib 1.x requires a target value. + if (relayState.empty()) + relayState = "default"; + + char timebuf[16]; + sprintf(timebuf,"%lu",time(NULL)); + const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder(); + auto_ptr_char dest(ep->getLocation()); + string req=string(dest.get()) + (strchr(dest.get(),'?') ? '&' : '?') + "shire=" + urlenc->encode(acsLocation) + + "&time=" + timebuf + "&target=" + urlenc->encode(relayState.c_str()) + + "&providerId=" + urlenc->encode(app.getRelyingParty(entity.first)->getString("entityID").second); + + return make_pair(true, httpResponse.sendRedirect(req.c_str())); +#else + return make_pair(false,0L); +#endif +} diff --git a/shibsp/handler/impl/StatusHandler.cpp b/shibsp/handler/impl/StatusHandler.cpp new file mode 100644 index 0000000..5f72c43 --- /dev/null +++ b/shibsp/handler/impl/StatusHandler.cpp @@ -0,0 +1,491 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * StatusHandler.cpp + * + * Handler for exposing information about the internals of the SP. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" +#include "util/CGIParser.h" + +using namespace shibsp; +#ifndef SHIBSP_LITE +# include "SessionCache.h" +# include +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmlsignature; +#endif +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + }; + + static SHIBSP_DLLLOCAL Blocker g_Blocker; + + class SHIBSP_API StatusHandler : public AbstractHandler, public RemotedHandler + { + public: + StatusHandler(const DOMElement* e, const char* appId); + virtual ~StatusHandler() {} + + pair run(SPRequest& request, bool isHandler=true) const; + void receive(DDF& in, ostream& out); + + private: + pair processMessage(const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse) const; + + set m_acl; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + Handler* SHIBSP_DLLLOCAL StatusHandlerFactory(const pair& p) + { + return new StatusHandler(p.first, p.second); + } + +#ifndef XMLTOOLING_NO_XMLSEC + vector g_NoCerts; +#else + vector g_NoCerts; +#endif + + static char _x2c(const char *what) + { + register char digit; + + digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 : (what[0] - '0')); + digit *= 16; + digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 : (what[1] - '0')); + return(digit); + } + + class DummyRequest : public HTTPRequest + { + public: + DummyRequest(const char* url) : m_parser(NULL), m_url(url), m_scheme(NULL), m_query(NULL), m_port(0) { +#ifdef HAVE_STRCASECMP + if (url && !strncasecmp(url,"http://",7)) { + m_scheme="http"; + url+=7; + } + else if (url && !strncasecmp(url,"https://",8)) { + m_scheme="https"; + url+=8; + } + else +#else + if (url && !strnicmp(url,"http://",7)) { + m_scheme="http"; + m_port = 80; + url+=7; + } + else if (url && !strnicmp(url,"https://",8)) { + m_scheme="https"; + m_port = 443; + url+=8; + } + else +#endif + throw invalid_argument("Target parameter was not an absolute URL."); + + m_query = strchr(url,'?'); + if (m_query) + m_query++; + + const char* slash = strchr(url, '/'); + const char* colon = strchr(url, ':'); + if (colon && colon < slash) { + m_hostname.assign(url, colon-url); + string port(colon + 1, slash - colon); + m_port = atoi(port.c_str()); + } + else { + m_hostname.assign(url, slash - url); + } + + while (*slash) { + if (*slash == '?') { + m_uri += slash; + break; + } + else if (*slash == ';') { + // If this is Java being stupid, skip everything up to the query string, if any. + if (!strncmp(slash, ";jsessionid=", 12)) { + if (slash = strchr(slash, '?')) + m_uri += slash; + break; + } + else { + m_uri += *slash; + } + } + else if (*slash != '%') { + m_uri += *slash; + } + else { + ++slash; + if (!isxdigit(*slash) || !isxdigit(*(slash+1))) + throw invalid_argument("Bad request, contained unsupported encoded characters."); + m_uri += _x2c(slash); + ++slash; + } + ++slash; + } + } + + ~DummyRequest() { + delete m_parser; + } + + const char* getRequestURL() const { + return m_url; + } + const char* getScheme() const { + return m_scheme; + } + const char* getHostname() const { + return m_hostname.c_str(); + } + int getPort() const { + return m_port; + } + const char* getRequestURI() const { + return m_uri.c_str(); + } + const char* getMethod() const { + return "GET"; + } + string getContentType() const { + return ""; + } + long getContentLength() const { + return 0; + } + string getRemoteAddr() const { + return ""; + } + string getRemoteUser() const { + return ""; + } + const char* getRequestBody() const { + return NULL; + } + const char* getQueryString() const { + return m_query; + } + const char* getParameter(const char* name) const + { + if (!m_parser) + m_parser=new CGIParser(*this); + + pair bounds=m_parser->getParameters(name); + return (bounds.first==bounds.second) ? NULL : bounds.first->second; + } + vector::size_type getParameters(const char* name, vector& values) const + { + if (!m_parser) + m_parser=new CGIParser(*this); + + pair bounds=m_parser->getParameters(name); + while (bounds.first!=bounds.second) { + values.push_back(bounds.first->second); + ++bounds.first; + } + return values.size(); + } + string getHeader(const char* name) const { + return ""; + } + virtual const +#ifndef XMLTOOLING_NO_XMLSEC + std::vector& +#else + std::vector& +#endif + getClientCertificates() const { + return g_NoCerts; + } + + private: + mutable CGIParser* m_parser; + const char* m_url; + const char* m_scheme; + const char* m_query; + int m_port; + string m_hostname,m_uri; + }; +}; + +StatusHandler::StatusHandler(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".StatusHandler"), &g_Blocker) +{ + string address(appId); + address += getString("Location").second; + setAddress(address.c_str()); + if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) { + pair acl = getString("acl"); + if (acl.first) { + string aclbuf=acl.second; + int j = 0; + for (unsigned int i=0; i < aclbuf.length(); i++) { + if (aclbuf.at(i)==' ') { + m_acl.insert(aclbuf.substr(j, i-j)); + j = i+1; + } + } + m_acl.insert(aclbuf.substr(j, aclbuf.length()-j)); + } + } +} + +pair StatusHandler::run(SPRequest& request, bool isHandler) const +{ + SPConfig& conf = SPConfig::getConfig(); + if (conf.isEnabled(SPConfig::InProcess)) { + if (!m_acl.empty() && m_acl.count(request.getRemoteAddr()) == 0) { + m_log.error("status handler request blocked from invalid address (%s)", request.getRemoteAddr().c_str()); + istringstream msg("Status Handler Blocked"); + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_UNAUTHORIZED)); + } + } + + const char* target = request.getParameter("target"); + if (target) { + // RequestMap query, so handle it inproc. + DummyRequest dummy(target); + RequestMapper::Settings settings = request.getApplication().getServiceProvider().getRequestMapper()->getSettings(dummy); + map props; + settings.first->getAll(props); + + request.setContentType("text/xml"); + stringstream msg; + msg << ""; + msg << ""; + msg << "::const_iterator p = props.begin(); p != props.end(); ++p) + msg << ' ' << p->first << "='" << p->second << "'"; + msg << '>' << target << ""; + msg << ""; + msg << ""; + return make_pair(true,request.sendResponse(msg)); + } + + try { + if (conf.isEnabled(SPConfig::OutOfProcess)) { + // When out of process, we run natively and directly process the message. + return processMessage(request.getApplication(), request, request); + } + else { + // When not out of process, we remote all the message processing. + DDF out,in = wrap(request); + DDFJanitor jin(in), jout(out); + out=request.getServiceProvider().getListenerService()->send(in); + return unwrap(request, out); + } + } + catch (XMLToolingException& ex) { + m_log.error("error while processing request: %s", ex.what()); + request.setContentType("text/xml"); + stringstream msg; + msg << ""; + msg << ""; + msg << "" << ex.what() << ""; + msg << ""; + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR)); + } + catch (exception& ex) { + m_log.error("error while processing request: %s", ex.what()); + request.setContentType("text/xml"); + stringstream msg; + msg << ""; + msg << ""; + msg << "" << ex.what() << ""; + msg << ""; + return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR)); + } +} + +void StatusHandler::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) for status request", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for status request, deleted?"); + } + + // Wrap a response shim. + DDF ret(NULL); + DDFJanitor jout(ret); + auto_ptr req(getRequest(in)); + auto_ptr resp(getResponse(ret)); + + // Since we're remoted, the result should either be a throw, a false/0 return, + // which we just return as an empty structure, or a response/redirect, + // which we capture in the facade and send back. + processMessage(*app, *req.get(), *resp.get()); + out << ret; +} + +pair StatusHandler::processMessage( + const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse + ) const +{ +#ifndef SHIBSP_LITE + m_log.debug("processing status request"); + + stringstream s; + s << ""; + const char* status = ""; + + s << ""; + + const char* param = NULL; + if (param) { + } + else { + // General configuration and status report. + try { + SessionCache* sc = application.getServiceProvider().getSessionCache(false); + if (sc) { + sc->test(); + s << ""; + } + else { + s << ""; + } + } + catch (XMLToolingException& ex) { + s << "" << ex.what() << ""; + status = ""; + } + catch (exception& ex) { + s << "" << ex.what() << ""; + status = ""; + } + + const PropertySet* relyingParty=NULL; + param=httpRequest.getParameter("entityID"); + if (param) { + MetadataProvider* m = application.getMetadataProvider(); + Locker mlock(m); + relyingParty = application.getRelyingParty(m->getEntityDescriptor(MetadataProvider::Criteria(param)).first); + } + else { + relyingParty = application.getRelyingParty(NULL); + } + + s << ""; + + s << ""; + vector handlers; + application.getHandlers(handlers); + for (vector::const_iterator h = handlers.begin(); h != handlers.end(); ++h) { + s << "getString("Binding").first) + s << " Binding='" << (*h)->getString("Binding").second << "'"; + s << "/>"; + } + s << ""; + + CredentialResolver* credResolver=application.getCredentialResolver(); + if (credResolver) { + Locker credLocker(credResolver); + CredentialCriteria cc; + cc.setUsage(Credential::SIGNING_CREDENTIAL); + pair keyName = relyingParty->getString("keyName"); + if (keyName.first) + cc.getKeyNames().insert(keyName.second); + vector creds; + credResolver->resolve(creds,&cc); + for (vector::const_iterator c = creds.begin(); c != creds.end(); ++c) { + KeyInfo* kinfo = (*c)->getKeyInfo(); + if (kinfo) { + auto_ptr kd(KeyDescriptorBuilder::buildKeyDescriptor()); + kd->setUse(KeyDescriptor::KEYTYPE_SIGNING); + kd->setKeyInfo(kinfo); + s << *(kd.get()); + } + } + + cc.setUsage(Credential::ENCRYPTION_CREDENTIAL); + creds.clear(); + cc.getKeyNames().clear(); + credResolver->resolve(creds,&cc); + for (vector::const_iterator c = creds.begin(); c != creds.end(); ++c) { + KeyInfo* kinfo = (*c)->getKeyInfo(); + if (kinfo) { + auto_ptr kd(KeyDescriptorBuilder::buildKeyDescriptor()); + kd->setUse(KeyDescriptor::KEYTYPE_ENCRYPTION); + kd->setKeyInfo(kinfo); + s << *(kd.get()); + } + } + } + } + + s << "" << status << ""; + + httpResponse.setContentType("text/xml"); + return make_pair(true, httpResponse.sendResponse(s)); +#else + return make_pair(false,0L); +#endif +} diff --git a/shibsp/handler/impl/TransformSessionInitiator.cpp b/shibsp/handler/impl/TransformSessionInitiator.cpp new file mode 100644 index 0000000..c265f7a --- /dev/null +++ b/shibsp/handler/impl/TransformSessionInitiator.cpp @@ -0,0 +1,282 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TransformSessionInitiator.cpp + * + * Support for mapping input into an entityID using a transform. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/RemotedHandler.h" +#include "handler/SessionInitiator.h" +#include "util/SPConstants.h" + +#ifndef SHIBSP_LITE +# include +#endif +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL TransformSINodeFilter : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + }; + + static SHIBSP_DLLLOCAL TransformSINodeFilter g_TSINFilter; + +#ifndef SHIBSP_LITE + static const XMLCh force[] = UNICODE_LITERAL_5(f,o,r,c,e); + static const XMLCh match[] = UNICODE_LITERAL_5(m,a,t,c,h); + static const XMLCh Regex[] = UNICODE_LITERAL_5(R,e,g,e,x); + static const XMLCh Subst[] = UNICODE_LITERAL_5(S,u,b,s,t); +#endif + + class SHIBSP_DLLLOCAL TransformSessionInitiator : public SessionInitiator, public AbstractHandler, public RemotedHandler + { + public: + TransformSessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.Transform"), &g_TSINFilter), m_appId(appId) { + // If Location isn't set, defer address registration until the setParent call. + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::TransformSI"; + setAddress(address.c_str()); + } + +#ifndef SHIBSP_LITE + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + m_alwaysRun = getBool("alwaysRun").second; + e = XMLHelper::getFirstChildElement(e); + while (e) { + if (e->hasChildNodes()) { + const XMLCh* flag = e->getAttributeNS(NULL, force); + if (!flag) + flag = &chNull; + if (XMLString::equals(e->getLocalName(), Subst)) { + auto_ptr_char temp(e->getFirstChild()->getNodeValue()); + m_subst.push_back(pair((*flag==chDigit_1 || *flag==chLatin_t), temp.get())); + } + else if (XMLString::equals(e->getLocalName(), Regex) && e->hasAttributeNS(NULL, match)) { + auto_ptr_char m(e->getAttributeNS(NULL, match)); + auto_ptr_char repl(e->getFirstChild()->getNodeValue()); + m_regex.push_back(make_pair((*flag==chDigit_1 || *flag==chLatin_t), pair(m.get(), repl.get()))); + } + else { + m_log.warn("Unknown element found in Transform SessionInitiator configuration, check for errors."); + } + } + e = XMLHelper::getNextSiblingElement(e); + } + } +#endif + } + + virtual ~TransformSessionInitiator() {} + + void setParent(const PropertySet* parent); + void receive(DDF& in, ostream& out); + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + + private: + void doRequest(const Application& application, string& entityID) const; + string m_appId; +#ifndef SHIBSP_LITE + bool m_alwaysRun; + vector< pair > m_subst; + vector< pair< bool, pair > > m_regex; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* SHIBSP_DLLLOCAL TransformSessionInitiatorFactory(const pair& p) + { + return new TransformSessionInitiator(p.first, p.second); + } + +}; + +void TransformSessionInitiator::setParent(const PropertySet* parent) +{ + DOMPropertySet::setParent(parent); + pair loc = getString("Location"); + if (loc.first) { + string address = m_appId + loc.second + "::run::TransformSI"; + setAddress(address.c_str()); + } + else { + m_log.warn("no Location property in Transform SessionInitiator (or parent), can't register as remoted handler"); + } +} + +pair TransformSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + // We have to have a candidate name to function. + if (entityID.empty()) + return make_pair(false,0L); + + string target; + const Application& app=request.getApplication(); + + m_log.debug("attempting to transform input (%s) into a valid entityID", entityID.c_str()); + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) + doRequest(app, entityID); + else { + // Remote the call. + DDF out,in = DDF(m_address.c_str()).structure(); + DDFJanitor jin(in), jout(out); + in.addmember("application_id").string(app.getId()); + in.addmember("entity_id").string(entityID.c_str()); + + // Remote the processing. + out = request.getServiceProvider().getListenerService()->send(in); + if (out.isstring()) + entityID = out.string(); + } + + return make_pair(false,0L); +} + +void TransformSessionInitiator::receive(DDF& in, ostream& out) +{ + // Find application. + const char* aid=in["application_id"].string(); + const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL; + if (!app) { + // Something's horribly wrong. + m_log.error("couldn't find application (%s) to generate AuthnRequest", aid ? aid : "(missing)"); + throw ConfigurationException("Unable to locate application for new session, deleted?"); + } + + const char* entityID = in["entity_id"].string(); + if (!entityID) + throw ConfigurationException("No entityID parameter supplied to remoted SessionInitiator."); + + string copy(entityID); + doRequest(*app, copy); + DDF ret = DDF(NULL).string(copy.c_str()); + DDFJanitor jout(ret); + out << ret; +} + +void TransformSessionInitiator::doRequest(const Application& application, string& entityID) const +{ +#ifndef SHIBSP_LITE + MetadataProvider* m=application.getMetadataProvider(); + Locker locker(m); + + MetadataProvider::Criteria mc(entityID.c_str(), &IDPSSODescriptor::ELEMENT_QNAME); + pair entity; + if (!m_alwaysRun) { + // First check the original value, it might be valid already. + entity = m->getEntityDescriptor(mc); + if (entity.first) + return; + } + + m_log.debug("attempting transform of (%s)", entityID.c_str()); + + // Guess not, try each subst. + string transform; + for (vector< pair >::const_iterator t = m_subst.begin(); t != m_subst.end(); ++t) { + string::size_type pos = t->second.find("$entityID"); + if (pos == string::npos) + continue; + transform = t->second; + transform.replace(pos, 9, entityID); + if (t->first) { + m_log.info("forcibly transformed entityID from (%s) to (%s)", entityID.c_str(), transform.c_str()); + entityID = transform; + } + + m_log.debug("attempting lookup with entityID (%s)", transform.c_str()); + + mc.entityID_ascii = transform.c_str(); + entity = m->getEntityDescriptor(mc); + if (entity.first) { + m_log.info("transformed entityID from (%s) to (%s)", entityID.c_str(), transform.c_str()); + if (!t->first) + entityID = transform; + return; + } + } + + // Now try regexs. + for (vector< pair< bool, pair > >::const_iterator r = m_regex.begin(); r != m_regex.end(); ++r) { + try { + RegularExpression exp(r->second.first.c_str()); + XMLCh* temp = exp.replace(entityID.c_str(), r->second.second.c_str()); + if (temp) { + auto_ptr_char narrow(temp); + XMLString::release(&temp); + + // For some reason it returns the match string if it doesn't match the expression. + if (entityID == narrow.get()) + continue; + + if (r->first) { + m_log.info("forcibly transformed entityID from (%s) to (%s)", entityID.c_str(), narrow.get()); + entityID = narrow.get(); + } + + m_log.debug("attempting lookup with entityID (%s)", narrow.get()); + + mc.entityID_ascii = narrow.get(); + entity = m->getEntityDescriptor(mc); + if (entity.first) { + m_log.info("transformed entityID from (%s) to (%s)", entityID.c_str(), narrow.get()); + if (!r->first) + entityID = narrow.get(); + return; + } + } + } + catch (XMLException& ex) { + auto_ptr_char msg(ex.getMessage()); + m_log.error("caught error applying regular expression: %s", msg.get()); + } + } + + m_log.warn("unable to find a valid entityID based on the supplied input"); +#endif +} diff --git a/shibsp/handler/impl/WAYFSessionInitiator.cpp b/shibsp/handler/impl/WAYFSessionInitiator.cpp new file mode 100644 index 0000000..19510ec --- /dev/null +++ b/shibsp/handler/impl/WAYFSessionInitiator.cpp @@ -0,0 +1,146 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * WAYFSessionInitiator.cpp + * + * Shibboleth WAYF support. + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "SPRequest.h" +#include "handler/AbstractHandler.h" +#include "handler/SessionInitiator.h" + +#include +#include +#include + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class SHIBSP_DLLLOCAL WAYFSessionInitiator : public SessionInitiator, public AbstractHandler + { + public: + WAYFSessionInitiator(const DOMElement* e, const char* appId) + : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.WAYF")), m_url(NULL) { + pair url = getString("URL"); + if (!url.first) + throw ConfigurationException("WAYF SessionInitiator requires a URL property."); + m_url = url.second; + } + virtual ~WAYFSessionInitiator() {} + + pair run(SPRequest& request, string& entityID, bool isHandler=true) const; + + private: + const char* m_url; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + SessionInitiator* SHIBSP_DLLLOCAL WAYFSessionInitiatorFactory(const pair& p) + { + return new WAYFSessionInitiator(p.first, p.second); + } + +}; + +pair WAYFSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const +{ + // The IdP CANNOT be specified for us to run. Otherwise, we'd be redirecting to a WAYF + // anytime the IdP's metadata was wrong. + if (!entityID.empty()) + return make_pair(false,0L); + + string target; + const char* option; + const Handler* ACS=NULL; + const Application& app=request.getApplication(); + + if (isHandler) { + option=request.getParameter("acsIndex"); + if (option) { + ACS=app.getAssertionConsumerServiceByIndex(atoi(option)); + if (!ACS) + request.log(SPRequest::SPWarn, "invalid acsIndex specified in request, using default ACS location"); + } + + option = request.getParameter("target"); + if (option) + target = option; + recoverRelayState(request.getApplication(), request, request, target, false); + } + else { + // We're running as a "virtual handler" from within the filter. + // The target resource is the current one and everything else is defaulted. + target=request.getRequestURL(); + } + + // Since we're not passing by index, we need to fully compute the return URL. + if (!ACS) { + pair index = getUnsignedInt("defaultACSIndex"); + if (index.first) { + ACS = app.getAssertionConsumerServiceByIndex(index.second); + if (!ACS) + request.log(SPRequest::SPWarn, "invalid defaultACSIndex, using default ACS location"); + } + if (!ACS) + ACS = app.getDefaultAssertionConsumerService(); + } + + m_log.debug("sending request to WAYF (%s)", m_url); + + // Compute the ACS URL. We add the ACS location to the base handlerURL. + string ACSloc=request.getHandlerURL(target.c_str()); + pair loc=ACS ? ACS->getString("Location") : pair(false,NULL); + if (loc.first) ACSloc+=loc.second; + + if (isHandler) { + // We may already have RelayState set if we looped back here, + // but just in case target is a resource, we reset it back. + option = request.getParameter("target"); + if (option) + target = option; + } + preserveRelayState(request.getApplication(), request, target); + + // WAYF requires a target value. + if (target.empty()) + target = "default"; + + char timebuf[16]; + sprintf(timebuf,"%lu",time(NULL)); + const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder(); + string req=string(m_url) + (strchr(m_url,'?') ? '&' : '?') + "shire=" + urlenc->encode(ACSloc.c_str()) + + "&time=" + timebuf + "&target=" + urlenc->encode(target.c_str()) + + "&providerId=" + urlenc->encode(app.getString("entityID").second); + + return make_pair(true, request.sendRedirect(req.c_str())); +} diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp new file mode 100644 index 0000000..b687d33 --- /dev/null +++ b/shibsp/impl/StorageServiceSessionCache.cpp @@ -0,0 +1,1668 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * StorageServiceSessionCache.cpp + * + * StorageService-based SessionCache implementation. + * + * Instead of optimizing this plugin with a buffering scheme that keeps objects around + * and avoids extra parsing steps, I'm assuming that systems that require such can + * layer their own cache plugin on top of this version either by delegating to it + * or using the remoting support. So this version will load sessions directly + * from the StorageService, instantiate enough to expose the Session API, + * and then delete everything when they're unlocked. All data in memory is always + * kept in sync with the StorageService (no lazy updates). + */ + +#include "internal.h" +#include "Application.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "SessionCacheEx.h" +#include "TransactionLog.h" +#include "attribute/Attribute.h" +#include "remoting/ListenerService.h" +#include "util/SPConstants.h" + +#include +#include +#include + +#ifndef SHIBSP_LITE +# include +# include +using namespace opensaml::saml2md; +#else +# include +# include +#endif + +using namespace shibsp; +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + class StoredSession; + class SSCache : public SessionCacheEx +#ifndef SHIBSP_LITE + ,public virtual Remoted +#endif + { + public: + SSCache(const DOMElement* e); + ~SSCache(); + +#ifndef SHIBSP_LITE + void receive(DDF& in, ostream& out); + + void insert( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + time_t expires, + const saml2md::EntityDescriptor* issuer=NULL, + const XMLCh* protocol=NULL, + const saml2::NameID* nameid=NULL, + const XMLCh* authn_instant=NULL, + const XMLCh* session_index=NULL, + const XMLCh* authncontext_class=NULL, + const XMLCh* authncontext_decl=NULL, + const vector* tokens=NULL, + const vector* attributes=NULL + ); + vector::size_type logout( + const Application& application, + const saml2md::EntityDescriptor* issuer, + const saml2::NameID& nameid, + const set* indexes, + time_t expires, + vector& sessions + ); + bool matches( + const Application& application, + const xmltooling::HTTPRequest& request, + const saml2md::EntityDescriptor* issuer, + const saml2::NameID& nameid, + const set* indexes + ); +#endif + Session* find(const Application& application, const char* key, const char* client_addr=NULL, time_t* timeout=NULL); + void remove(const Application& application, const char* key); + void test(); + + string active(const Application& application, const xmltooling::HTTPRequest& request) { + pair shib_cookie = application.getCookieNameProps("_shibsession_"); + const char* session_id = request.getCookie(shib_cookie.first.c_str()); + return (session_id ? session_id : ""); + } + + Session* find(const Application& application, const HTTPRequest& request, const char* client_addr=NULL, time_t* timeout=NULL) { + string id = active(application, request); + if (!id.empty()) + return find(application, id.c_str(), client_addr, timeout); + return NULL; + } + + void remove(const Application& application, const HTTPRequest& request, HTTPResponse* response=NULL) { + pair shib_cookie = application.getCookieNameProps("_shibsession_"); + const char* session_id = request.getCookie(shib_cookie.first.c_str()); + if (session_id && *session_id) { + if (response) + response->setCookie(shib_cookie.first.c_str(), shib_cookie.second); + remove(application, session_id); + } + } + + void cleanup(); + + Category& m_log; + bool inproc; + unsigned long m_cacheTimeout; +#ifndef SHIBSP_LITE + StorageService* m_storage; +#endif + + private: +#ifndef SHIBSP_LITE + // maintain back-mappings of NameID/SessionIndex -> session key + void insert(const char* key, time_t expires, const char* name, const char* index); + bool stronglyMatches(const XMLCh* idp, const XMLCh* sp, const saml2::NameID& n1, const saml2::NameID& n2) const; +#endif + + const DOMElement* m_root; // Only valid during initialization + unsigned long m_inprocTimeout; + + // inproc means we buffer sessions in memory + RWLock* m_lock; + map m_hashtable; + + // management of buffered sessions + void dormant(const char* key); + static void* cleanup_fn(void*); + bool shutdown; + CondWait* shutdown_wait; + Thread* cleanup_thread; + }; + + class StoredSession : public virtual Session + { + public: + StoredSession(SSCache* cache, DDF& obj) : m_obj(obj), +#ifndef SHIBSP_LITE + m_nameid(NULL), +#endif + m_cache(cache), m_expires(0), m_lastAccess(time(NULL)), m_lock(NULL) { + auto_ptr_XMLCh exp(m_obj["expires"].string()); + if (exp.get()) { + DateTime iso(exp.get()); + iso.parseDateTime(); + m_expires = iso.getEpoch(); + } + +#ifndef SHIBSP_LITE + const char* nameid = obj["nameid"].string(); + if (nameid) { + // Parse and bind the document into an XMLObject. + istringstream instr(nameid); + DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr); + XercesJanitor janitor(doc); + auto_ptr n(saml2::NameIDBuilder::buildNameID()); + n->unmarshall(doc->getDocumentElement(), true); + janitor.release(); + m_nameid = n.release(); + } +#endif + if (cache->inproc) + m_lock = Mutex::create(); + } + + ~StoredSession() { + delete m_lock; + m_obj.destroy(); + for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup()); +#ifndef SHIBSP_LITE + delete m_nameid; + for_each(m_tokens.begin(), m_tokens.end(), cleanup_pair()); +#endif + } + + Lockable* lock() { + if (m_lock) + m_lock->lock(); + return this; + } + void unlock() { + if (m_lock) + m_lock->unlock(); + else + delete this; + } + + const char* getID() const { + return m_obj.name(); + } + const char* getApplicationID() const { + return m_obj["application_id"].string(); + } + const char* getClientAddress() const { + return m_obj["client_addr"].string(); + } + const char* getEntityID() const { + return m_obj["entity_id"].string(); + } + const char* getProtocol() const { + return m_obj["protocol"].string(); + } + const char* getAuthnInstant() const { + return m_obj["authn_instant"].string(); + } +#ifndef SHIBSP_LITE + const saml2::NameID* getNameID() const { + return m_nameid; + } +#endif + const char* getSessionIndex() const { + return m_obj["session_index"].string(); + } + const char* getAuthnContextClassRef() const { + return m_obj["authncontext_class"].string(); + } + const char* getAuthnContextDeclRef() const { + return m_obj["authncontext_decl"].string(); + } + const vector& getAttributes() const { + if (m_attributes.empty()) + unmarshallAttributes(); + return m_attributes; + } + const multimap& getIndexedAttributes() const { + if (m_attributeIndex.empty()) { + if (m_attributes.empty()) + unmarshallAttributes(); + for (vector::const_iterator a = m_attributes.begin(); a != m_attributes.end(); ++a) { + const vector& aliases = (*a)->getAliases(); + for (vector::const_iterator alias = aliases.begin(); alias != aliases.end(); ++alias) + m_attributeIndex.insert(multimap::value_type(*alias, *a)); + } + } + return m_attributeIndex; + } + const vector& getAssertionIDs() const { + if (m_ids.empty()) { + DDF ids = m_obj["assertions"]; + DDF id = ids.first(); + while (id.isstring()) { + m_ids.push_back(id.string()); + id = ids.next(); + } + } + return m_ids; + } + + void validate(const Application& application, const char* client_addr, time_t* timeout); + +#ifndef SHIBSP_LITE + void addAttributes(const vector& attributes); + const Assertion* getAssertion(const char* id) const; + void addAssertion(Assertion* assertion); +#endif + + time_t getExpiration() const { return m_expires; } + time_t getLastAccess() const { return m_lastAccess; } + + private: + void unmarshallAttributes() const; + + DDF m_obj; +#ifndef SHIBSP_LITE + saml2::NameID* m_nameid; + mutable map m_tokens; +#endif + mutable vector m_attributes; + mutable multimap m_attributeIndex; + mutable vector m_ids; + + SSCache* m_cache; + time_t m_expires,m_lastAccess; + Mutex* m_lock; + }; + + SessionCache* SHIBSP_DLLLOCAL StorageServiceCacheFactory(const DOMElement* const & e) + { + return new SSCache(e); + } +} + +void SHIBSP_API shibsp::registerSessionCaches() +{ + SPConfig::getConfig().SessionCacheManager.registerFactory(STORAGESERVICE_SESSION_CACHE, StorageServiceCacheFactory); +} + +void StoredSession::unmarshallAttributes() const +{ + Attribute* attribute; + DDF attrs = m_obj["attributes"]; + DDF attr = attrs.first(); + while (!attr.isnull()) { + try { + attribute = Attribute::unmarshall(attr); + m_attributes.push_back(attribute); + if (m_cache->m_log.isDebugEnabled()) + m_cache->m_log.debug("unmarshalled attribute (ID: %s) with %d value%s", + attribute->getId(), attr.first().integer(), attr.first().integer()!=1 ? "s" : ""); + } + catch (AttributeException& ex) { + const char* id = attr.first().name(); + m_cache->m_log.error("error unmarshalling attribute (ID: %s): %s", id ? id : "none", ex.what()); + } + attr = attrs.next(); + } +} + +void StoredSession::validate(const Application& application, const char* client_addr, time_t* timeout) +{ + time_t now = time(NULL); + + // Basic expiration? + if (m_expires > 0) { + if (now > m_expires) { + m_cache->m_log.info("session expired (ID: %s)", getID()); + throw RetryableProfileException("Your session has expired, and you must re-authenticate."); + } + } + + // Address check? + if (client_addr) { + if (m_cache->m_log.isDebugEnabled()) + m_cache->m_log.debug("comparing client address %s against %s", client_addr, getClientAddress()); + if (!XMLString::equals(getClientAddress(),client_addr)) { + m_cache->m_log.warn("client address mismatch"); + throw RetryableProfileException( + "Your IP address ($1) does not match the address recorded at the time the session was established.", + params(1,client_addr) + ); + } + } + + if (!timeout) + return; + + if (!SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + DDF in("touch::"STORAGESERVICE_SESSION_CACHE"::SessionCache"), out; + DDFJanitor jin(in); + in.structure(); + in.addmember("key").string(getID()); + in.addmember("version").integer(m_obj["version"].integer()); + if (*timeout) { + // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps. +#ifndef HAVE_GMTIME_R + struct tm* ptime=gmtime(timeout); +#else + struct tm res; + struct tm* ptime=gmtime_r(timeout,&res); +#endif + char timebuf[32]; + strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime); + in.addmember("timeout").string(timebuf); + } + + try { + out=application.getServiceProvider().getListenerService()->send(in); + } + catch (...) { + out.destroy(); + throw; + } + + if (out.isstruct()) { + // We got an updated record back. + m_ids.clear(); + for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup()); + m_attributes.clear(); + m_attributeIndex.clear(); + m_obj.destroy(); + m_obj = out; + } + } + else { +#ifndef SHIBSP_LITE + if (!m_cache->m_storage) + throw ConfigurationException("Session touch requires a StorageService."); + + // Do a versioned read. + string record; + time_t lastAccess; + int curver = m_obj["version"].integer(); + int ver = m_cache->m_storage->readText(getID(), "session", &record, &lastAccess, curver); + if (ver == 0) { + m_cache->m_log.warn("unsuccessful versioned read of session (ID: %s), cache out of sync?", getID()); + throw RetryableProfileException("Your session has expired, and you must re-authenticate."); + } + + // Adjust for expiration to recover last access time and check timeout. + lastAccess -= m_cache->m_cacheTimeout; + if (*timeout > 0 && now - lastAccess >= *timeout) { + m_cache->m_log.info("session timed out (ID: %s)", getID()); + throw RetryableProfileException("Your session has expired, and you must re-authenticate."); + } + + // Update storage expiration, if possible. + try { + m_cache->m_storage->updateContext(getID(), now + m_cache->m_cacheTimeout); + } + catch (exception& ex) { + m_cache->m_log.error("failed to update session expiration: %s", ex.what()); + } + + if (ver > curver) { + // We got an updated record back. + DDF newobj; + istringstream in(record); + in >> newobj; + m_ids.clear(); + for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup()); + m_attributes.clear(); + m_attributeIndex.clear(); + m_obj.destroy(); + m_obj = newobj; + } +#else + throw ConfigurationException("Session touch requires a StorageService."); +#endif + } + + m_lastAccess = now; +} + +#ifndef SHIBSP_LITE + +void StoredSession::addAttributes(const vector& attributes) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("addAttributes"); +#endif + + if (!m_cache->m_storage) + throw ConfigurationException("Session modification requires a StorageService."); + + m_cache->m_log.debug("adding attributes to session (%s)", getID()); + + int ver; + do { + DDF attr; + DDF attrs = m_obj["attributes"]; + if (!attrs.islist()) + attrs = m_obj.addmember("attributes").list(); + for (vector::const_iterator a=attributes.begin(); a!=attributes.end(); ++a) { + attr = (*a)->marshall(); + attrs.add(attr); + } + + // Tentatively increment the version. + m_obj["version"].integer(m_obj["version"].integer()+1); + + ostringstream str; + str << m_obj; + string record(str.str()); + + try { + ver = m_cache->m_storage->updateText(getID(), "session", record.c_str(), 0, m_obj["version"].integer()-1); + } + catch (exception&) { + // Roll back modification to record. + m_obj["version"].integer(m_obj["version"].integer()-1); + vector::size_type count = attributes.size(); + while (count--) + attrs.last().destroy(); + throw; + } + + if (ver <= 0) { + // Roll back modification to record. + m_obj["version"].integer(m_obj["version"].integer()-1); + vector::size_type count = attributes.size(); + while (count--) + attrs.last().destroy(); + } + if (!ver) { + // Fatal problem with update. + throw IOException("Unable to update stored session."); + } + else if (ver < 0) { + // Out of sync. + m_cache->m_log.warn("storage service indicates the record is out of sync, updating with a fresh copy..."); + ver = m_cache->m_storage->readText(getID(), "session", &record, NULL); + if (!ver) { + m_cache->m_log.error("readText failed on StorageService for session (%s)", getID()); + throw IOException("Unable to read back stored session."); + } + + // Reset object. + DDF newobj; + istringstream in(record); + in >> newobj; + + m_ids.clear(); + for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup()); + m_attributes.clear(); + m_attributeIndex.clear(); + newobj["version"].integer(ver); + m_obj.destroy(); + m_obj = newobj; + + ver = -1; + } + } while (ver < 0); // negative indicates a sync issue so we retry + + TransactionLog* xlog = SPConfig::getConfig().getServiceProvider()->getTransactionLog(); + Locker locker(xlog); + xlog->log.infoStream() << + "Added the following attributes to session (ID: " << + getID() << + ") for (applicationId: " << + m_obj["application_id"].string() << + ") {"; + for (vector::const_iterator a=attributes.begin(); a!=attributes.end(); ++a) + xlog->log.infoStream() << "\t" << (*a)->getId() << " (" << (*a)->valueCount() << " values)"; + xlog->log.info("}"); + + // We own them now, so clean them up. + for_each(attributes.begin(), attributes.end(), xmltooling::cleanup()); +} + +const Assertion* StoredSession::getAssertion(const char* id) const +{ + if (!m_cache->m_storage) + throw ConfigurationException("Assertion retrieval requires a StorageService."); + + map::const_iterator i = m_tokens.find(id); + if (i!=m_tokens.end()) + return i->second; + + string tokenstr; + if (!m_cache->m_storage->readText(getID(), id, &tokenstr, NULL)) + throw FatalProfileException("Assertion not found in cache."); + + // Parse and bind the document into an XMLObject. + istringstream instr(tokenstr); + DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr); + XercesJanitor janitor(doc); + auto_ptr xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true)); + janitor.release(); + + Assertion* token = dynamic_cast(xmlObject.get()); + if (!token) + throw FatalProfileException("Request for cached assertion returned an unknown object type."); + + // Transfer ownership to us. + xmlObject.release(); + m_tokens[id]=token; + return token; +} + +void StoredSession::addAssertion(Assertion* assertion) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("addAssertion"); +#endif + + if (!m_cache->m_storage) + throw ConfigurationException("Session modification requires a StorageService."); + + if (!assertion) + throw FatalProfileException("Unknown object type passed to session for storage."); + + auto_ptr_char id(assertion->getID()); + + m_cache->m_log.debug("adding assertion (%s) to session (%s)", id.get(), getID()); + + time_t exp; + if (!m_cache->m_storage->readText(getID(), "session", NULL, &exp)) + throw IOException("Unable to load expiration time for stored session."); + + ostringstream tokenstr; + tokenstr << *assertion; + if (!m_cache->m_storage->createText(getID(), id.get(), tokenstr.str().c_str(), exp)) + throw IOException("Attempted to insert duplicate assertion ID into session."); + + int ver; + do { + DDF token = DDF(NULL).string(id.get()); + m_obj["assertions"].add(token); + + // Tentatively increment the version. + m_obj["version"].integer(m_obj["version"].integer()+1); + + ostringstream str; + str << m_obj; + string record(str.str()); + + try { + ver = m_cache->m_storage->updateText(getID(), "session", record.c_str(), 0, m_obj["version"].integer()-1); + } + catch (exception&) { + token.destroy(); + m_obj["version"].integer(m_obj["version"].integer()-1); + m_cache->m_storage->deleteText(getID(), id.get()); + throw; + } + + if (ver <= 0) { + token.destroy(); + m_obj["version"].integer(m_obj["version"].integer()-1); + } + if (!ver) { + // Fatal problem with update. + m_cache->m_log.error("updateText failed on StorageService for session (%s)", getID()); + m_cache->m_storage->deleteText(getID(), id.get()); + throw IOException("Unable to update stored session."); + } + else if (ver < 0) { + // Out of sync. + m_cache->m_log.warn("storage service indicates the record is out of sync, updating with a fresh copy..."); + ver = m_cache->m_storage->readText(getID(), "session", &record, NULL); + if (!ver) { + m_cache->m_log.error("readText failed on StorageService for session (%s)", getID()); + m_cache->m_storage->deleteText(getID(), id.get()); + throw IOException("Unable to read back stored session."); + } + + // Reset object. + DDF newobj; + istringstream in(record); + in >> newobj; + + m_ids.clear(); + for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup()); + m_attributes.clear(); + m_attributeIndex.clear(); + newobj["version"].integer(ver); + m_obj.destroy(); + m_obj = newobj; + + ver = -1; + } + } while (ver < 0); // negative indicates a sync issue so we retry + + m_ids.clear(); + delete assertion; + + TransactionLog* xlog = SPConfig::getConfig().getServiceProvider()->getTransactionLog(); + Locker locker(xlog); + xlog->log.info( + "Added assertion (ID: %s) to session for (applicationId: %s) with (ID: %s)", + id.get(), m_obj["application_id"].string(), getID() + ); +} + +#endif + +SSCache::SSCache(const DOMElement* e) + : m_log(Category::getInstance(SHIBSP_LOGCAT".SessionCache")), inproc(true), m_cacheTimeout(3600), +#ifndef SHIBSP_LITE + m_storage(NULL), +#endif + m_root(e), m_inprocTimeout(900), m_lock(NULL), shutdown(false), shutdown_wait(NULL), cleanup_thread(NULL) +{ + static const XMLCh cacheTimeout[] = UNICODE_LITERAL_12(c,a,c,h,e,T,i,m,e,o,u,t); + static const XMLCh inprocTimeout[] = UNICODE_LITERAL_13(i,n,p,r,o,c,T,i,m,e,o,u,t); + static const XMLCh _StorageService[] = UNICODE_LITERAL_14(S,t,o,r,a,g,e,S,e,r,v,i,c,e); + + SPConfig& conf = SPConfig::getConfig(); + inproc = conf.isEnabled(SPConfig::InProcess); + + if (e) { + const XMLCh* tag=e->getAttributeNS(NULL,cacheTimeout); + if (tag && *tag) { + m_cacheTimeout = XMLString::parseInt(tag); + if (!m_cacheTimeout) + m_cacheTimeout=3600; + } + if (inproc) { + const XMLCh* tag=e->getAttributeNS(NULL,inprocTimeout); + if (tag && *tag) { + m_inprocTimeout = XMLString::parseInt(tag); + if (!m_inprocTimeout) + m_inprocTimeout=900; + } + } + } + +#ifndef SHIBSP_LITE + if (conf.isEnabled(SPConfig::OutOfProcess)) { + const XMLCh* tag = e ? e->getAttributeNS(NULL,_StorageService) : NULL; + if (tag && *tag) { + auto_ptr_char ssid(tag); + m_storage = conf.getServiceProvider()->getStorageService(ssid.get()); + if (m_storage) + m_log.info("bound to StorageService (%s)", ssid.get()); + } + if (!m_storage) + throw ConfigurationException("SessionCache unable to locate StorageService, check configuration."); + } +#endif + + ListenerService* listener=conf.getServiceProvider()->getListenerService(false); + if (inproc ) { + if (!conf.isEnabled(SPConfig::OutOfProcess) && !listener) + throw ConfigurationException("SessionCache requires a ListenerService, but none available."); + m_lock = RWLock::create(); + shutdown_wait = CondWait::create(); + cleanup_thread = Thread::create(&cleanup_fn, (void*)this); + } +#ifndef SHIBSP_LITE + else { + if (listener && conf.isEnabled(SPConfig::OutOfProcess)) { + listener->regListener("find::"STORAGESERVICE_SESSION_CACHE"::SessionCache",this); + listener->regListener("remove::"STORAGESERVICE_SESSION_CACHE"::SessionCache",this); + listener->regListener("touch::"STORAGESERVICE_SESSION_CACHE"::SessionCache",this); + } + else { + m_log.info("no ListenerService available, cache remoting disabled"); + } + } +#endif +} + +SSCache::~SSCache() +{ + if (inproc) { + // Shut down the cleanup thread and let it know... + shutdown = true; + shutdown_wait->signal(); + cleanup_thread->join(NULL); + + for_each(m_hashtable.begin(),m_hashtable.end(),cleanup_pair()); + delete m_lock; + delete shutdown_wait; + } +#ifndef SHIBSP_LITE + else { + SPConfig& conf = SPConfig::getConfig(); + ListenerService* listener=conf.getServiceProvider()->getListenerService(false); + if (listener && conf.isEnabled(SPConfig::OutOfProcess)) { + listener->unregListener("find::"STORAGESERVICE_SESSION_CACHE"::SessionCache",this); + listener->unregListener("remove::"STORAGESERVICE_SESSION_CACHE"::SessionCache",this); + listener->unregListener("touch::"STORAGESERVICE_SESSION_CACHE"::SessionCache",this); + } + } +#endif +} + +#ifndef SHIBSP_LITE + +void SSCache::test() +{ + auto_ptr_char temp(SAMLConfig::getConfig().generateIdentifier()); + m_storage->createString("SessionCacheTest", temp.get(), "Test", time(NULL) + 60); + m_storage->deleteString("SessionCacheTest", temp.get()); +} + +void SSCache::insert(const char* key, time_t expires, const char* name, const char* index) +{ + string dup; + if (strlen(name) > 255) { + dup = string(name).substr(0,255); + name = dup.c_str(); + } + + DDF obj; + DDFJanitor jobj(obj); + + // Since we can't guarantee uniqueness, check for an existing record. + string record; + time_t recordexp; + int ver = m_storage->readText("NameID", name, &record, &recordexp); + if (ver > 0) { + // Existing record, so we need to unmarshall it. + istringstream in(record); + in >> obj; + } + else { + // New record. + obj.structure(); + } + + if (!index || !*index) + index = "_shibnull"; + DDF sessions = obj.addmember(index); + if (!sessions.islist()) + sessions.list(); + DDF session = DDF(NULL).string(key); + sessions.add(session); + + // Remarshall the record. + ostringstream out; + out << obj; + + // Try and store it back... + if (ver > 0) { + ver = m_storage->updateText("NameID", name, out.str().c_str(), max(expires, recordexp), ver); + if (ver <= 0) { + // Out of sync, or went missing, so retry. + return insert(key, expires, name, index); + } + } + else if (!m_storage->createText("NameID", name, out.str().c_str(), expires)) { + // Hit a dup, so just retry, hopefully hitting the other branch. + return insert(key, expires, name, index); + } +} + +void SSCache::insert( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + time_t expires, + const saml2md::EntityDescriptor* issuer, + const XMLCh* protocol, + const saml2::NameID* nameid, + const XMLCh* authn_instant, + const XMLCh* session_index, + const XMLCh* authncontext_class, + const XMLCh* authncontext_decl, + const vector* tokens, + const vector* attributes + ) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("insert"); +#endif + if (!m_storage) + throw ConfigurationException("SessionCache insertion requires a StorageService."); + + m_log.debug("creating new session"); + + time_t now = time(NULL); + auto_ptr_char index(session_index); + auto_ptr_char entity_id(issuer ? issuer->getEntityID() : NULL); + auto_ptr_char name(nameid ? nameid->getName() : NULL); + + if (nameid) { + // Check for a pending logout. + if (strlen(name.get()) > 255) + const_cast(name.get())[255] = 0; + string pending; + int ver = m_storage->readText("Logout", name.get(), &pending); + if (ver > 0) { + DDF pendobj; + DDFJanitor jpend(pendobj); + istringstream pstr(pending); + pstr >> pendobj; + // IdP.SP.index contains logout expiration, if any. + DDF deadmenwalking = pendobj[issuer ? entity_id.get() : "_shibnull"][application.getRelyingParty(issuer)->getString("entityID").second]; + const char* logexpstr = deadmenwalking[session_index ? index.get() : "_shibnull"].string(); + if (!logexpstr && session_index) // we tried an exact session match, now try for NULL + logexpstr = deadmenwalking["_shibnull"].string(); + if (logexpstr) { + auto_ptr_XMLCh dt(logexpstr); + DateTime dtobj(dt.get()); + dtobj.parseDateTime(); + time_t logexp = dtobj.getEpoch(); + if (now - XMLToolingConfig::getConfig().clock_skew_secs < logexp) + throw FatalProfileException("A logout message from your identity provider has blocked your login attempt."); + } + } + } + + auto_ptr_char key(SAMLConfig::getConfig().generateIdentifier()); + + // Store session properties in DDF. + DDF obj = DDF(key.get()).structure(); + obj.addmember("version").integer(1); + obj.addmember("application_id").string(application.getId()); + + // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps. +#ifndef HAVE_GMTIME_R + struct tm* ptime=gmtime(&expires); +#else + struct tm res; + struct tm* ptime=gmtime_r(&expires,&res); +#endif + char timebuf[32]; + strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime); + obj.addmember("expires").string(timebuf); + + obj.addmember("client_addr").string(httpRequest.getRemoteAddr().c_str()); + if (issuer) + obj.addmember("entity_id").string(entity_id.get()); + if (protocol) { + auto_ptr_char prot(protocol); + obj.addmember("protocol").string(prot.get()); + } + if (authn_instant) { + auto_ptr_char instant(authn_instant); + obj.addmember("authn_instant").string(instant.get()); + } + if (session_index) + obj.addmember("session_index").string(index.get()); + if (authncontext_class) { + auto_ptr_char ac(authncontext_class); + obj.addmember("authncontext_class").string(ac.get()); + } + if (authncontext_decl) { + auto_ptr_char ad(authncontext_decl); + obj.addmember("authncontext_decl").string(ad.get()); + } + + if (nameid) { + ostringstream namestr; + namestr << *nameid; + obj.addmember("nameid").string(namestr.str().c_str()); + } + + if (tokens) { + obj.addmember("assertions").list(); + for (vector::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) { + auto_ptr_char tokenid((*t)->getID()); + DDF tokid = DDF(NULL).string(tokenid.get()); + obj["assertions"].add(tokid); + } + } + + if (attributes) { + DDF attr; + DDF attrlist = obj.addmember("attributes").list(); + for (vector::const_iterator a=attributes->begin(); a!=attributes->end(); ++a) { + attr = (*a)->marshall(); + attrlist.add(attr); + } + } + + ostringstream record; + record << obj; + + m_log.debug("storing new session..."); + if (!m_storage->createText(key.get(), "session", record.str().c_str(), now + m_cacheTimeout)) + throw FatalProfileException("Attempted to create a session with a duplicate key."); + + // Store the reverse mapping for logout. + try { + if (nameid) + insert(key.get(), expires, name.get(), index.get()); + } + catch (exception& ex) { + m_log.error("error storing back mapping of NameID for logout: %s", ex.what()); + } + + if (tokens) { + try { + for (vector::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) { + ostringstream tokenstr; + tokenstr << *(*t); + auto_ptr_char tokenid((*t)->getID()); + if (!m_storage->createText(key.get(), tokenid.get(), tokenstr.str().c_str(), now + m_cacheTimeout)) + throw IOException("duplicate assertion ID ($1)", params(1, tokenid.get())); + } + } + catch (exception& ex) { + m_log.error("error storing assertion along with session: %s", ex.what()); + } + } + + const char* pid = obj["entity_id"].string(); + const char* prot = obj["protocol"].string(); + m_log.info("new session created: ID (%s) IdP (%s) Protocol(%s) Address (%s)", + key.get(), pid ? pid : "none", prot ? prot : "none", httpRequest.getRemoteAddr().c_str()); + + // Transaction Logging + TransactionLog* xlog = application.getServiceProvider().getTransactionLog(); + Locker locker(xlog); + xlog->log.infoStream() << + "New session (ID: " << + key.get() << + ") with (applicationId: " << + application.getId() << + ") for principal from (IdP: " << + (pid ? pid : "none") << + ") at (ClientAddress: " << + httpRequest.getRemoteAddr() << + ") with (NameIdentifier: " << + (nameid ? name.get() : "none") << + ") using (Protocol: " << + (prot ? prot : "none") << + ")"; + + if (attributes) { + xlog->log.infoStream() << + "Cached the following attributes with session (ID: " << + key.get() << + ") for (applicationId: " << + application.getId() << + ") {"; + for (vector::const_iterator a=attributes->begin(); a!=attributes->end(); ++a) + xlog->log.infoStream() << "\t" << (*a)->getId() << " (" << (*a)->valueCount() << " values)"; + xlog->log.info("}"); + } + + pair shib_cookie = application.getCookieNameProps("_shibsession_"); + string k(key.get()); + k += shib_cookie.second; + httpResponse.setCookie(shib_cookie.first.c_str(), k.c_str()); +} + +bool SSCache::matches( + const Application& application, + const xmltooling::HTTPRequest& request, + const saml2md::EntityDescriptor* issuer, + const saml2::NameID& nameid, + const set* indexes + ) +{ + auto_ptr_char entityID(issuer ? issuer->getEntityID() : NULL); + try { + Session* session = find(application, request); + if (session) { + Locker locker(session, false); + if (XMLString::equals(session->getEntityID(), entityID.get()) && session->getNameID() && + stronglyMatches(issuer->getEntityID(), application.getRelyingParty(issuer)->getXMLString("entityID").second, nameid, *session->getNameID())) { + return (!indexes || indexes->empty() || (session->getSessionIndex() ? (indexes->count(session->getSessionIndex())>0) : false)); + } + } + } + catch (exception& ex) { + m_log.error("error while matching session: %s", ex.what()); + } + return false; +} + +vector::size_type SSCache::logout( + const Application& application, + const saml2md::EntityDescriptor* issuer, + const saml2::NameID& nameid, + const set* indexes, + time_t expires, + vector& sessionsKilled + ) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("logout"); +#endif + + if (!m_storage) + throw ConfigurationException("SessionCache insertion requires a StorageService."); + + auto_ptr_char entityID(issuer ? issuer->getEntityID() : NULL); + auto_ptr_char name(nameid.getName()); + + m_log.info("request to logout sessions from (%s) for (%s)", entityID.get() ? entityID.get() : "unknown", name.get()); + + if (strlen(name.get()) > 255) + const_cast(name.get())[255] = 0; + + DDF obj; + DDFJanitor jobj(obj); + string record; + int ver; + + if (expires) { + // Record the logout to prevent post-delivered assertions. + // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps. +#ifndef HAVE_GMTIME_R + struct tm* ptime=gmtime(&expires); +#else + struct tm res; + struct tm* ptime=gmtime_r(&expires,&res); +#endif + char timebuf[32]; + strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime); + + time_t oldexp = 0; + ver = m_storage->readText("Logout", name.get(), &record, &oldexp); + if (ver > 0) { + istringstream lin(record); + lin >> obj; + } + else { + obj = DDF(NULL).structure(); + } + + // Structure is keyed by the IdP and SP, with a member per session index containing the expiration. + DDF root = obj.addmember(issuer ? entityID.get() : "_shibnull").addmember(application.getRelyingParty(issuer)->getString("entityID").second); + if (indexes) { + for (set::const_iterator x = indexes->begin(); x!=indexes->end(); ++x) + root.addmember(x->c_str()).string(timebuf); + } + else { + root.addmember("_shibnull").string(timebuf); + } + + // Write it back. + ostringstream lout; + lout << obj; + + if (ver > 0) { + ver = m_storage->updateText("Logout", name.get(), lout.str().c_str(), max(expires, oldexp), ver); + if (ver <= 0) { + // Out of sync, or went missing, so retry. + return logout(application, issuer, nameid, indexes, expires, sessionsKilled); + } + } + else if (!m_storage->createText("Logout", name.get(), lout.str().c_str(), expires)) { + // Hit a dup, so just retry, hopefully hitting the other branch. + return logout(application, issuer, nameid, indexes, expires, sessionsKilled); + } + + obj.destroy(); + record.erase(); + } + + // Read in potentially matching sessions. + ver = m_storage->readText("NameID", name.get(), &record); + if (ver == 0) { + m_log.debug("no active sessions to logout for supplied issuer and subject"); + return 0; + } + + istringstream in(record); + in >> obj; + + // The record contains child lists for each known session index. + DDF key; + DDF sessions = obj.first(); + while (sessions.islist()) { + if (!indexes || indexes->empty() || indexes->count(sessions.name())) { + key = sessions.first(); + while (key.isstring()) { + // Fetch the session for comparison. + Session* session = NULL; + try { + session = find(application, key.string()); + } + catch (exception& ex) { + m_log.error("error locating session (%s): %s", key.string(), ex.what()); + } + + if (session) { + Locker locker(session, false); + // Same issuer? + if (XMLString::equals(session->getEntityID(), entityID.get())) { + // Same NameID? + if (stronglyMatches(issuer->getEntityID(), application.getRelyingParty(issuer)->getXMLString("entityID").second, nameid, *session->getNameID())) { + sessionsKilled.push_back(key.string()); + key.destroy(); + } + else { + m_log.debug("session (%s) contained a non-matching NameID, leaving it alone", key.string()); + } + } + else { + m_log.debug("session (%s) established by different IdP, leaving it alone", key.string()); + } + } + else { + // Session's gone, so... + sessionsKilled.push_back(key.string()); + key.destroy(); + } + key = sessions.next(); + } + + // No sessions left for this index? + if (sessions.first().isnull()) + sessions.destroy(); + } + sessions = obj.next(); + } + + if (obj.first().isnull()) + obj.destroy(); + + // If possible, write back the mapping record (this isn't crucial). + try { + if (obj.isnull()) { + m_storage->deleteText("NameID", name.get()); + } + else if (!sessionsKilled.empty()) { + ostringstream out; + out << obj; + if (m_storage->updateText("NameID", name.get(), out.str().c_str(), 0, ver) <= 0) + m_log.warn("logout mapping record changed behind us, leaving it alone"); + } + } + catch (exception& ex) { + m_log.error("error updating logout mapping record: %s", ex.what()); + } + + return sessionsKilled.size(); +} + +bool SSCache::stronglyMatches(const XMLCh* idp, const XMLCh* sp, const saml2::NameID& n1, const saml2::NameID& n2) const +{ + if (!XMLString::equals(n1.getName(), n2.getName())) + return false; + + const XMLCh* s1 = n1.getFormat(); + const XMLCh* s2 = n2.getFormat(); + if (!s1 || !*s1) + s1 = saml2::NameID::UNSPECIFIED; + if (!s2 || !*s2) + s2 = saml2::NameID::UNSPECIFIED; + if (!XMLString::equals(s1,s2)) + return false; + + s1 = n1.getNameQualifier(); + s2 = n2.getNameQualifier(); + if (!s1 || !*s1) + s1 = idp; + if (!s2 || !*s2) + s2 = idp; + if (!XMLString::equals(s1,s2)) + return false; + + s1 = n1.getSPNameQualifier(); + s2 = n2.getSPNameQualifier(); + if (!s1 || !*s1) + s1 = sp; + if (!s2 || !*s2) + s2 = sp; + if (!XMLString::equals(s1,s2)) + return false; + + return true; +} + +#endif + +Session* SSCache::find(const Application& application, const char* key, const char* client_addr, time_t* timeout) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("find"); +#endif + StoredSession* session=NULL; + + if (inproc) { + m_log.debug("searching local cache for session (%s)", key); + m_lock->rdlock(); + map::const_iterator i=m_hashtable.find(key); + if (i!=m_hashtable.end()) { + // Save off and lock the session. + session = i->second; + session->lock(); + m_lock->unlock(); + m_log.debug("session found locally, validating it for use"); + } + else { + m_lock->unlock(); + } + } + + if (!session) { + if (!SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + m_log.debug("session not found locally, remoting the search"); + // Remote the request. + DDF in("find::"STORAGESERVICE_SESSION_CACHE"::SessionCache"), out; + DDFJanitor jin(in); + in.structure(); + in.addmember("key").string(key); + in.addmember("application_id").string(application.getId()); + if (timeout && *timeout) { + // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps. +#ifndef HAVE_GMTIME_R + struct tm* ptime=gmtime(timeout); +#else + struct tm res; + struct tm* ptime=gmtime_r(timeout,&res); +#endif + char timebuf[32]; + strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime); + in.addmember("timeout").string(timebuf); + } + + try { + out=application.getServiceProvider().getListenerService()->send(in); + if (!out.isstruct()) { + out.destroy(); + m_log.debug("session not found in remote cache"); + return NULL; + } + + // Wrap the results in a local entry and save it. + session = new StoredSession(this, out); + // The remote end has handled timeout issues, we handle address and expiration checks. + timeout = NULL; + } + catch (...) { + out.destroy(); + throw; + } + } + else { + // We're out of process, so we can search the storage service directly. +#ifndef SHIBSP_LITE + if (!m_storage) + throw ConfigurationException("SessionCache lookup requires a StorageService."); + + m_log.debug("searching for session (%s)", key); + + DDF obj; + time_t lastAccess; + string record; + int ver = m_storage->readText(key, "session", &record, &lastAccess); + if (!ver) + return NULL; + + m_log.debug("reconstituting session and checking validity"); + + istringstream in(record); + in >> obj; + + lastAccess -= m_cacheTimeout; // adjusts it back to the last time the record's timestamp was touched + time_t now=time(NULL); + + if (timeout && *timeout > 0 && now - lastAccess >= *timeout) { + m_log.info("session timed out (ID: %s)", key); + remove(application, key); + const char* eid = obj["entity_id"].string(); + if (!eid) { + obj.destroy(); + throw RetryableProfileException("Your session has expired, and you must re-authenticate."); + } + string eid2(eid); + obj.destroy(); + throw RetryableProfileException("Your session has expired, and you must re-authenticate.", namedparams(1, "entityID", eid2.c_str())); + } + + if (timeout) { + // Update storage expiration, if possible. + try { + m_storage->updateContext(key, now + m_cacheTimeout); + } + catch (exception& ex) { + m_log.error("failed to update session expiration: %s", ex.what()); + } + } + + // Wrap the results in a local entry and save it. + session = new StoredSession(this, obj); + // We handled timeout issues, still need to handle address and expiration checks. + timeout = NULL; +#else + throw ConfigurationException("SessionCache search requires a StorageService."); +#endif + } + + if (inproc) { + // Lock for writing and repeat the search to avoid duplication. + m_lock->wrlock(); + SharedLock shared(m_lock, false); + if (m_hashtable.count(key)) { + // We're using an existing session entry. + delete session; + session = m_hashtable[key]; + session->lock(); + } + else { + m_hashtable[key]=session; + session->lock(); + } + } + } + + if (!XMLString::equals(session->getApplicationID(), application.getId())) { + m_log.error("an application (%s) tried to access another application's session", application.getId()); + session->unlock(); + return NULL; + } + + // Verify currency and update the timestamp if indicated by caller. + try { + session->validate(application, client_addr, timeout); + } + catch (...) { + session->unlock(); + remove(application, key); + throw; + } + + return session; +} + +void SSCache::remove(const Application& application, const char* key) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("remove"); +#endif + // Take care of local copy. + if (inproc) + dormant(key); + + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + // Remove the session from storage directly. +#ifndef SHIBSP_LITE + m_storage->deleteContext(key); + m_log.info("removed session (%s)", key); + + TransactionLog* xlog = application.getServiceProvider().getTransactionLog(); + Locker locker(xlog); + xlog->log.info("Destroyed session (applicationId: %s) (ID: %s)", application.getId(), key); +#else + throw ConfigurationException("SessionCache removal requires a StorageService."); +#endif + } + else { + // Remote the request. + DDF in("remove::"STORAGESERVICE_SESSION_CACHE"::SessionCache"); + DDFJanitor jin(in); + in.structure(); + in.addmember("key").string(key); + in.addmember("application_id").string(application.getId()); + + DDF out = application.getServiceProvider().getListenerService()->send(in); + out.destroy(); + } +} + +void SSCache::dormant(const char* key) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("dormant"); +#endif + + m_log.debug("deleting local copy of session (%s)", key); + + // lock the cache for writing, which means we know nobody is sitting in find() + m_lock->wrlock(); + + // grab the entry from the table + map::const_iterator i=m_hashtable.find(key); + if (i==m_hashtable.end()) { + m_lock->unlock(); + return; + } + + // ok, remove the entry and lock it + StoredSession* entry=i->second; + m_hashtable.erase(key); + entry->lock(); + + // unlock the cache + m_lock->unlock(); + + // we can release the cache entry lock because we know we're not in the cache anymore + entry->unlock(); + + delete entry; +} + +void SSCache::cleanup() +{ +#ifdef _DEBUG + xmltooling::NDC ndc("cleanup"); +#endif + + Mutex* mutex = Mutex::create(); + + // Load our configuration details... + static const XMLCh cleanupInterval[] = UNICODE_LITERAL_15(c,l,e,a,n,u,p,I,n,t,e,r,v,a,l); + const XMLCh* tag=m_root ? m_root->getAttributeNS(NULL,cleanupInterval) : NULL; + int rerun_timer = 900; + if (tag && *tag) + rerun_timer = XMLString::parseInt(tag); + if (rerun_timer <= 0) + rerun_timer = 900; + + mutex->lock(); + + m_log.info("cleanup thread started...run every %d secs; timeout after %d secs", rerun_timer, m_inprocTimeout); + + while (!shutdown) { + shutdown_wait->timedwait(mutex,rerun_timer); + if (shutdown) + break; + + // Ok, let's run through the cleanup process and clean out + // really old sessions. This is a two-pass process. The + // first pass is done holding a read-lock while we iterate over + // the cache. The second pass doesn't need a lock because + // the 'deletes' will lock the cache. + + // Pass 1: iterate over the map and find all entries that have not been + // used in the allotted timeout. + vector stale_keys; + time_t stale = time(NULL) - m_inprocTimeout; + + m_log.debug("cleanup thread running"); + + m_lock->rdlock(); + for (map::const_iterator i=m_hashtable.begin(); i!=m_hashtable.end(); ++i) { + // If the last access was BEFORE the stale timeout... + i->second->lock(); + time_t last=i->second->getLastAccess(); + i->second->unlock(); + if (last < stale) + stale_keys.push_back(i->first); + } + m_lock->unlock(); + + if (!stale_keys.empty()) { + m_log.info("purging %d old sessions", stale_keys.size()); + + // Pass 2: walk through the list of stale entries and remove them from the cache + for (vector::const_iterator j = stale_keys.begin(); j != stale_keys.end(); ++j) + dormant(j->c_str()); + } + + m_log.debug("cleanup thread completed"); + } + + m_log.info("cleanup thread exiting"); + + mutex->unlock(); + delete mutex; + Thread::exit(NULL); +} + +void* SSCache::cleanup_fn(void* cache_p) +{ +#ifndef WIN32 + // First, let's block all signals + Thread::mask_all_signals(); +#endif + + // Now run the cleanup process. + reinterpret_cast(cache_p)->cleanup(); + return NULL; +} + +#ifndef SHIBSP_LITE + +void SSCache::receive(DDF& in, ostream& out) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("receive"); +#endif + + if (!strcmp(in.name(),"find::"STORAGESERVICE_SESSION_CACHE"::SessionCache")) { + const char* key=in["key"].string(); + if (!key) + throw ListenerException("Required parameters missing for session lookup."); + + const Application* app = SPConfig::getConfig().getServiceProvider()->getApplication(in["application_id"].string()); + if (!app) + throw ListenerException("Application not found, check configuration?"); + + // Do an unversioned read. + string record; + time_t lastAccess; + if (!m_storage->readText(key, "session", &record, &lastAccess)) { + DDF ret(NULL); + DDFJanitor jan(ret); + out << ret; + return; + } + + // Adjust for expiration to recover last access time and check timeout. + lastAccess -= m_cacheTimeout; + time_t now=time(NULL); + + // See if we need to check for a timeout. + if (in["timeout"].string()) { + time_t timeout = 0; + auto_ptr_XMLCh dt(in["timeout"].string()); + DateTime dtobj(dt.get()); + dtobj.parseDateTime(); + timeout = dtobj.getEpoch(); + + if (timeout > 0 && now - lastAccess >= timeout) { + m_log.info("session timed out (ID: %s)", key); + remove(*app, key); + throw RetryableProfileException("Your session has expired, and you must re-authenticate."); + } + + // Update storage expiration, if possible. + try { + m_storage->updateContext(key, now + m_cacheTimeout); + } + catch (exception& ex) { + m_log.error("failed to update session expiration: %s", ex.what()); + } + } + + // Send the record back. + out << record; + } + else if (!strcmp(in.name(),"touch::"STORAGESERVICE_SESSION_CACHE"::SessionCache")) { + const char* key=in["key"].string(); + if (!key) + throw ListenerException("Required parameters missing for session check."); + + // Do a versioned read. + string record; + time_t lastAccess; + int curver = in["version"].integer(); + int ver = m_storage->readText(key, "session", &record, &lastAccess, curver); + if (ver == 0) { + m_log.warn("unsuccessful versioned read of session (ID: %s), caches out of sync?", key); + throw RetryableProfileException("Your session has expired, and you must re-authenticate."); + } + + // Adjust for expiration to recover last access time and check timeout. + lastAccess -= m_cacheTimeout; + time_t now=time(NULL); + + // See if we need to check for a timeout. + time_t timeout = 0; + auto_ptr_XMLCh dt(in["timeout"].string()); + if (dt.get()) { + DateTime dtobj(dt.get()); + dtobj.parseDateTime(); + timeout = dtobj.getEpoch(); + } + + if (timeout > 0 && now - lastAccess >= timeout) { + m_log.info("session timed out (ID: %s)", key); + throw RetryableProfileException("Your session has expired, and you must re-authenticate."); + } + + // Update storage expiration, if possible. + try { + m_storage->updateContext(key, now + m_cacheTimeout); + } + catch (exception& ex) { + m_log.error("failed to update session expiration: %s", ex.what()); + } + + if (ver > curver) { + // Send the record back. + out << record; + } + else { + DDF ret(NULL); + DDFJanitor jan(ret); + out << ret; + } + } + else if (!strcmp(in.name(),"remove::"STORAGESERVICE_SESSION_CACHE"::SessionCache")) { + const char* key=in["key"].string(); + if (!key) + throw ListenerException("Required parameter missing for session removal."); + + const Application* app = SPConfig::getConfig().getServiceProvider()->getApplication(in["application_id"].string()); + if (!app) + throw ConfigurationException("Application not found, check configuration?"); + + remove(*app, key); + DDF ret(NULL); + DDFJanitor jan(ret); + out << ret; + } +} + +#endif diff --git a/shibsp/impl/XMLAccessControl.cpp b/shibsp/impl/XMLAccessControl.cpp new file mode 100644 index 0000000..939ea68 --- /dev/null +++ b/shibsp/impl/XMLAccessControl.cpp @@ -0,0 +1,450 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * XMLAccessControl.cpp + * + * XML-based access control syntax + */ + +#include "internal.h" +#include "exceptions.h" +#include "AccessControl.h" +#include "SessionCache.h" +#include "SPRequest.h" +#include "attribute/Attribute.h" + +#include +#include +#include +#include + +#ifndef HAVE_STRCASECMP +# define strcasecmp _stricmp +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace { + + class Rule : public AccessControl + { + public: + Rule(const DOMElement* e); + ~Rule() {} + + Lockable* lock() {return this;} + void unlock() {} + + aclresult_t authorized(const SPRequest& request, const Session* session) const; + + private: + string m_alias; + vector m_vals; + }; + + class RuleRegex : public AccessControl + { + public: + RuleRegex(const DOMElement* e); + ~RuleRegex() { + delete m_re; + } + + Lockable* lock() {return this;} + void unlock() {} + + aclresult_t authorized(const SPRequest& request, const Session* session) const; + + private: + string m_alias; + auto_arrayptr m_exp; + RegularExpression* m_re; + }; + + class Operator : public AccessControl + { + public: + Operator(const DOMElement* e); + ~Operator(); + + Lockable* lock() {return this;} + void unlock() {} + + aclresult_t authorized(const SPRequest& request, const Session* session) const; + + private: + enum operator_t { OP_NOT, OP_AND, OP_OR } m_op; + vector m_operands; + }; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class XMLAccessControl : public AccessControl, public ReloadableXMLFile + { + public: + XMLAccessControl(const DOMElement* e) + : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".AccessControl")), m_rootAuthz(NULL) { + load(); // guarantees an exception or the policy is loaded + } + + ~XMLAccessControl() { + delete m_rootAuthz; + } + + aclresult_t authorized(const SPRequest& request, const Session* session) const; + + protected: + pair load(); + + private: + AccessControl* m_rootAuthz; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + AccessControl* SHIBSP_DLLLOCAL XMLAccessControlFactory(const DOMElement* const & e) + { + return new XMLAccessControl(e); + } + + static const XMLCh _AccessControl[] = UNICODE_LITERAL_13(A,c,c,e,s,s,C,o,n,t,r,o,l); + static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e); + static const XMLCh ignoreOption[] = UNICODE_LITERAL_1(i); + static const XMLCh _list[] = UNICODE_LITERAL_4(l,i,s,t); + static const XMLCh require[] = UNICODE_LITERAL_7(r,e,q,u,i,r,e); + static const XMLCh NOT[] = UNICODE_LITERAL_3(N,O,T); + static const XMLCh AND[] = UNICODE_LITERAL_3(A,N,D); + static const XMLCh OR[] = UNICODE_LITERAL_2(O,R); + static const XMLCh _Rule[] = UNICODE_LITERAL_4(R,u,l,e); + static const XMLCh _RuleRegex[] = UNICODE_LITERAL_9(R,u,l,e,R,e,g,e,x); +} + +void SHIBSP_API shibsp::registerAccessControls() +{ + SPConfig& conf=SPConfig::getConfig(); + conf.AccessControlManager.registerFactory(XML_ACCESS_CONTROL, XMLAccessControlFactory); + conf.AccessControlManager.registerFactory("edu.internet2.middleware.shibboleth.sp.provider.XMLAccessControl", XMLAccessControlFactory); +} + +Rule::Rule(const DOMElement* e) +{ + auto_ptr_char req(e->getAttributeNS(NULL,require)); + if (!req.get() || !*req.get()) + throw ConfigurationException("Access control rule missing require attribute"); + m_alias=req.get(); + + auto_arrayptr vals(toUTF8(e->hasChildNodes() ? e->getFirstChild()->getNodeValue() : NULL)); + if (!vals.get()) + return; + + const XMLCh* flag = e->getAttributeNS(NULL,_list); + if (flag && (*flag == chLatin_f || *flag == chDigit_0)) { + if (*vals.get()) + m_vals.push_back(vals.get()); + return; + } + +#ifdef HAVE_STRTOK_R + char* pos=NULL; + const char* token=strtok_r(const_cast(vals.get())," ",&pos); +#else + const char* token=strtok(const_cast(vals.get())," "); +#endif + while (token) { + m_vals.push_back(token); +#ifdef HAVE_STRTOK_R + token=strtok_r(NULL," ",&pos); +#else + token=strtok(NULL," "); +#endif + } +} + +AccessControl::aclresult_t Rule::authorized(const SPRequest& request, const Session* session) const +{ + // We can make this more complex later using pluggable comparison functions, + // but for now, just a straight port to the new Attribute API. + + // Map alias in rule to the attribute. + if (!session) { + request.log(SPRequest::SPWarn, "AccessControl plugin not given a valid session to evaluate, are you using lazy sessions?"); + return shib_acl_false; + } + + if (m_alias == "valid-user") { + if (session) { + request.log(SPRequest::SPDebug,"AccessControl plugin accepting valid-user based on active session"); + return shib_acl_true; + } + return shib_acl_false; + } + if (m_alias == "user") { + for (vector::const_iterator i=m_vals.begin(); i!=m_vals.end(); ++i) { + if (*i == request.getRemoteUser()) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting REMOTE_USER (") + *i + "), authz granted"); + return shib_acl_true; + } + } + return shib_acl_false; + } + else if (m_alias == "authnContextClassRef") { + const char* ref = session->getAuthnContextClassRef(); + for (vector::const_iterator i=m_vals.begin(); ref && i!=m_vals.end(); ++i) { + if (!strcmp(i->c_str(),ref)) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting authnContextClassRef (") + *i + "), authz granted"); + return shib_acl_true; + } + } + return shib_acl_false; + } + else if (m_alias == "authnContextDeclRef") { + const char* ref = session->getAuthnContextDeclRef(); + for (vector::const_iterator i=m_vals.begin(); ref && i!=m_vals.end(); ++i) { + if (!strcmp(i->c_str(),ref)) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting authnContextDeclRef (") + *i + "), authz granted"); + return shib_acl_true; + } + } + return shib_acl_false; + } + + // Find the attribute(s) matching the require rule. + pair::const_iterator, multimap::const_iterator> attrs = + session->getIndexedAttributes().equal_range(m_alias); + if (attrs.first == attrs.second) { + request.log(SPRequest::SPWarn, string("rule requires attribute (") + m_alias + "), not found in session"); + return shib_acl_false; + } + + for (; attrs.first != attrs.second; ++attrs.first) { + bool caseSensitive = attrs.first->second->isCaseSensitive(); + + // Now we have to intersect the attribute's values against the rule's list. + const vector& vals = attrs.first->second->getSerializedValues(); + for (vector::const_iterator i=m_vals.begin(); i!=m_vals.end(); ++i) { + for (vector::const_iterator j=vals.begin(); j!=vals.end(); ++j) { + if ((caseSensitive && *i == *j) || (!caseSensitive && !strcasecmp(i->c_str(),j->c_str()))) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting (") + *j + "), authz granted"); + return shib_acl_true; + } + } + } + } + + return shib_acl_false; +} + +RuleRegex::RuleRegex(const DOMElement* e) : m_exp(toUTF8(e->hasChildNodes() ? e->getFirstChild()->getNodeValue() : NULL)) +{ + auto_ptr_char req(e->getAttributeNS(NULL,require)); + if (!req.get() || !*req.get() || !m_exp.get() || !*m_exp.get()) + throw ConfigurationException("Access control rule missing require attribute or element content."); + m_alias=req.get(); + + const XMLCh* flag = e->getAttributeNS(NULL,ignoreCase); + bool ignore = (flag && (*flag == chLatin_t || *flag == chDigit_1)); + try { + m_re = new RegularExpression(e->getFirstChild()->getNodeValue(), (ignore ? ignoreOption : &chNull)); + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + throw ConfigurationException("Caught exception while parsing RuleRegex regular expression: $1", params(1,tmp.get())); + } +} + +AccessControl::aclresult_t RuleRegex::authorized(const SPRequest& request, const Session* session) const +{ + // Map alias in rule to the attribute. + if (!session) { + request.log(SPRequest::SPWarn, "AccessControl plugin not given a valid session to evaluate, are you using lazy sessions?"); + return shib_acl_false; + } + + if (m_alias == "valid-user") { + if (session) { + request.log(SPRequest::SPDebug,"AccessControl plugin accepting valid-user based on active session"); + return shib_acl_true; + } + return shib_acl_false; + } + + try { + if (m_alias == "user") { + if (m_re->matches(request.getRemoteUser().c_str())) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting REMOTE_USER (") + m_exp.get() + "), authz granted"); + return shib_acl_true; + } + return shib_acl_false; + } + else if (m_alias == "authnContextClassRef") { + if (session->getAuthnContextClassRef() && m_re->matches(session->getAuthnContextClassRef())) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting authnContextClassRef (") + m_exp.get() + "), authz granted"); + return shib_acl_true; + } + return shib_acl_false; + } + else if (m_alias == "authnContextDeclRef") { + if (session->getAuthnContextDeclRef() && m_re->matches(session->getAuthnContextDeclRef())) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting authnContextDeclRef (") + m_exp.get() + "), authz granted"); + return shib_acl_true; + } + return shib_acl_false; + } + + // Find the attribute(s) matching the require rule. + pair::const_iterator, multimap::const_iterator> attrs = + session->getIndexedAttributes().equal_range(m_alias); + if (attrs.first == attrs.second) { + request.log(SPRequest::SPWarn, string("rule requires attribute (") + m_alias + "), not found in session"); + return shib_acl_false; + } + + for (; attrs.first != attrs.second; ++attrs.first) { + // Now we have to intersect the attribute's values against the regular expression. + const vector& vals = attrs.first->second->getSerializedValues(); + for (vector::const_iterator j=vals.begin(); j!=vals.end(); ++j) { + if (m_re->matches(j->c_str())) { + request.log(SPRequest::SPDebug, string("AccessControl plugin expecting (") + m_exp.get() + "), authz granted"); + return shib_acl_true; + } + } + } + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + request.log(SPRequest::SPError, string("caught exception while parsing RuleRegex regular expression: ") + tmp.get()); + } + + return shib_acl_false; +} + +Operator::Operator(const DOMElement* e) +{ + if (XMLString::equals(e->getLocalName(),NOT)) + m_op=OP_NOT; + else if (XMLString::equals(e->getLocalName(),AND)) + m_op=OP_AND; + else if (XMLString::equals(e->getLocalName(),OR)) + m_op=OP_OR; + else + throw ConfigurationException("Unrecognized operator in access control rule"); + + try { + e=XMLHelper::getFirstChildElement(e); + if (XMLString::equals(e->getLocalName(),_Rule)) + m_operands.push_back(new Rule(e)); + else if (XMLString::equals(e->getLocalName(),_RuleRegex)) + m_operands.push_back(new RuleRegex(e)); + else + m_operands.push_back(new Operator(e)); + + if (m_op==OP_NOT) + return; + + e=XMLHelper::getNextSiblingElement(e); + while (e) { + if (XMLString::equals(e->getLocalName(),_Rule)) + m_operands.push_back(new Rule(e)); + else if (XMLString::equals(e->getLocalName(),_RuleRegex)) + m_operands.push_back(new RuleRegex(e)); + else + m_operands.push_back(new Operator(e)); + e=XMLHelper::getNextSiblingElement(e); + } + } + catch (exception&) { + for_each(m_operands.begin(),m_operands.end(),xmltooling::cleanup()); + throw; + } +} + +Operator::~Operator() +{ + for_each(m_operands.begin(),m_operands.end(),xmltooling::cleanup()); +} + +AccessControl::aclresult_t Operator::authorized(const SPRequest& request, const Session* session) const +{ + switch (m_op) { + case OP_NOT: + switch (m_operands.front()->authorized(request,session)) { + case shib_acl_true: + return shib_acl_false; + case shib_acl_false: + return shib_acl_true; + default: + return shib_acl_indeterminate; + } + + case OP_AND: + { + for (vector::const_iterator i=m_operands.begin(); i!=m_operands.end(); i++) { + if ((*i)->authorized(request,session) != shib_acl_true) + return shib_acl_false; + } + return shib_acl_true; + } + + case OP_OR: + { + for (vector::const_iterator i=m_operands.begin(); i!=m_operands.end(); i++) { + if ((*i)->authorized(request,session) == shib_acl_true) + return shib_acl_true; + } + return shib_acl_false; + } + } + request.log(SPRequest::SPWarn,"unknown operation in access control policy, denying access"); + return shib_acl_false; +} + +pair XMLAccessControl::load() +{ + // Load from source using base class. + pair raw = ReloadableXMLFile::load(); + + // If we own it, wrap it. + XercesJanitor docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL); + + // Check for AccessControl wrapper and drop a level. + if (XMLString::equals(raw.second->getLocalName(),_AccessControl)) + raw.second = XMLHelper::getFirstChildElement(raw.second); + + AccessControl* authz; + if (XMLString::equals(raw.second->getLocalName(),_Rule)) + authz=new Rule(raw.second); + else if (XMLString::equals(raw.second->getLocalName(),_RuleRegex)) + authz=new RuleRegex(raw.second); + else + authz=new Operator(raw.second); + + delete m_rootAuthz; + m_rootAuthz = authz; + return make_pair(false,(DOMElement*)NULL); +} + +AccessControl::aclresult_t XMLAccessControl::authorized(const SPRequest& request, const Session* session) const +{ + return m_rootAuthz ? m_rootAuthz->authorized(request,session) : shib_acl_false; +} diff --git a/shibsp/impl/XMLRequestMapper.cpp b/shibsp/impl/XMLRequestMapper.cpp new file mode 100644 index 0000000..9c5f294 --- /dev/null +++ b/shibsp/impl/XMLRequestMapper.cpp @@ -0,0 +1,654 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** XMLRequestMapper.cpp + * + * XML-based RequestMapper implementation + */ + +#include "internal.h" +#include "exceptions.h" +#include "AccessControl.h" +#include "RequestMapper.h" +#include "SPRequest.h" +#include "util/DOMPropertySet.h" +#include "util/SPConstants.h" + +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + // Blocks access when an ACL plugin fails to load. + class AccessControlDummy : public AccessControl + { + public: + Lockable* lock() { + return this; + } + + void unlock() {} + + aclresult_t authorized(const SPRequest& request, const Session* session) const { + return shib_acl_false; + } + }; + + class Override : public DOMPropertySet, public DOMNodeFilter + { + public: + Override() : m_acl(NULL) {} + Override(const DOMElement* e, Category& log, const Override* base=NULL); + ~Override(); + + // Provides filter to exclude special config elements. + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + + const Override* locate(const HTTPRequest& request) const; + AccessControl* getAC() const { return (m_acl ? m_acl : (getParent() ? dynamic_cast(getParent())->getAC() : NULL)); } + + protected: + void loadACL(const DOMElement* e, Category& log); + + map m_map; + vector< pair > m_regexps; + vector< pair< pair,Override*> > m_queries; + + private: + AccessControl* m_acl; + }; + + class XMLRequestMapperImpl : public Override + { + public: + XMLRequestMapperImpl(const DOMElement* e, Category& log); + + ~XMLRequestMapperImpl() { + if (m_document) + m_document->release(); + } + + void setDocument(DOMDocument* doc) { + m_document = doc; + } + + const Override* findOverride(const char* vhost, const HTTPRequest& request) const; + + private: + map m_extras; + DOMDocument* m_document; + }; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + class XMLRequestMapper : public RequestMapper, public ReloadableXMLFile + { + public: + XMLRequestMapper(const DOMElement* e) : ReloadableXMLFile(e,Category::getInstance(SHIBSP_LOGCAT".RequestMapper")), m_impl(NULL) { + load(); + } + + ~XMLRequestMapper() { + delete m_impl; + } + + Settings getSettings(const HTTPRequest& request) const; + + protected: + pair load(); + + private: + XMLRequestMapperImpl* m_impl; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + RequestMapper* SHIBSP_DLLLOCAL XMLRequestMapperFactory(const DOMElement* const & e) + { + return new XMLRequestMapper(e); + } + + static const XMLCh _AccessControl[] = UNICODE_LITERAL_13(A,c,c,e,s,s,C,o,n,t,r,o,l); + static const XMLCh AccessControlProvider[] = UNICODE_LITERAL_21(A,c,c,e,s,s,C,o,n,t,r,o,l,P,r,o,v,i,d,e,r); + static const XMLCh Host[] = UNICODE_LITERAL_4(H,o,s,t); + static const XMLCh HostRegex[] = UNICODE_LITERAL_9(H,o,s,t,R,e,g,e,x); + static const XMLCh htaccess[] = UNICODE_LITERAL_8(h,t,a,c,c,e,s,s); + static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e); + static const XMLCh ignoreOption[] = UNICODE_LITERAL_1(i); + static const XMLCh Path[] = UNICODE_LITERAL_4(P,a,t,h); + static const XMLCh PathRegex[] = UNICODE_LITERAL_9(P,a,t,h,R,e,g,e,x); + static const XMLCh Query[] = UNICODE_LITERAL_5(Q,u,e,r,y); + static const XMLCh name[] = UNICODE_LITERAL_4(n,a,m,e); + static const XMLCh regex[] = UNICODE_LITERAL_5(r,e,g,e,x); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); +} + +void SHIBSP_API shibsp::registerRequestMappers() +{ + SPConfig& conf=SPConfig::getConfig(); + conf.RequestMapperManager.registerFactory(XML_REQUEST_MAPPER, XMLRequestMapperFactory); + conf.RequestMapperManager.registerFactory(NATIVE_REQUEST_MAPPER, XMLRequestMapperFactory); +} + +void Override::loadACL(const DOMElement* e, Category& log) +{ + try { + const DOMElement* acl=XMLHelper::getFirstChildElement(e,htaccess); + if (acl) { + log.info("building Apache htaccess AccessControl provider..."); + m_acl=SPConfig::getConfig().AccessControlManager.newPlugin(HT_ACCESS_CONTROL,acl); + } + else { + acl=XMLHelper::getFirstChildElement(e,_AccessControl); + if (acl) { + log.info("building XML-based AccessControl provider..."); + m_acl=SPConfig::getConfig().AccessControlManager.newPlugin(XML_ACCESS_CONTROL,acl); + } + else { + acl=XMLHelper::getFirstChildElement(e,AccessControlProvider); + if (acl) { + auto_ptr_char type(acl->getAttributeNS(NULL,_type)); + log.info("building AccessControl provider of type %s...",type.get()); + m_acl=SPConfig::getConfig().AccessControlManager.newPlugin(type.get(),acl); + } + } + } + } + catch (exception& ex) { + log.crit("exception building AccessControl provider: %s", ex.what()); + m_acl = new AccessControlDummy(); + } +} + +Override::Override(const DOMElement* e, Category& log, const Override* base) : m_acl(NULL) +{ + try { + // Load the property set. + load(e,NULL,this); + setParent(base); + + // Load any AccessControl provider. + loadACL(e,log); + + // Handle nested Paths. + DOMElement* path = XMLHelper::getFirstChildElement(e,Path); + for (int i=1; path; ++i, path=XMLHelper::getNextSiblingElement(path,Path)) { + const XMLCh* n=path->getAttributeNS(NULL,name); + + // Skip any leading slashes. + while (n && *n==chForwardSlash) + n++; + + // Check for empty name. + if (!n || !*n) { + log.warn("skipping Path element (%d) with empty name attribute", i); + continue; + } + + // Check for an embedded slash. + int slash=XMLString::indexOf(n,chForwardSlash); + if (slash>0) { + // Copy the first path segment. + XMLCh* namebuf=new XMLCh[slash + 1]; + for (int pos=0; pos < slash; pos++) + namebuf[pos]=n[pos]; + namebuf[slash]=chNull; + + // Move past the slash in the original pathname. + n=n+slash+1; + + // Skip any leading slashes again. + while (*n==chForwardSlash) + n++; + + if (*n) { + // Create a placeholder Path element for the first path segment and replant under it. + DOMElement* newpath=path->getOwnerDocument()->createElementNS(shibspconstants::SHIB2SPCONFIG_NS,Path); + newpath->setAttributeNS(NULL,name,namebuf); + path->setAttributeNS(NULL,name,n); + path->getParentNode()->replaceChild(newpath,path); + newpath->appendChild(path); + + // Repoint our locals at the new parent. + path=newpath; + n=path->getAttributeNS(NULL,name); + } + else { + // All we had was a pathname with trailing slash(es), so just reset it without them. + path->setAttributeNS(NULL,name,namebuf); + n=path->getAttributeNS(NULL,name); + } + delete[] namebuf; + } + + Override* o=new Override(path,log,this); + pair name=o->getString("name"); + char* dup=strdup(name.second); + for (char* pch=dup; *pch; pch++) + *pch=tolower(*pch); + if (m_map.count(dup)) { + log.warn("skipping duplicate Path element (%s)",dup); + free(dup); + delete o; + continue; + } + m_map[dup]=o; + log.debug("added Path mapping (%s)", dup); + free(dup); + } + + if (!XMLString::equals(e->getLocalName(), PathRegex)) { + // Handle nested PathRegexs. + path = XMLHelper::getFirstChildElement(e,PathRegex); + for (int i=1; path; ++i, path=XMLHelper::getNextSiblingElement(path,PathRegex)) { + const XMLCh* n=path->getAttributeNS(NULL,regex); + if (!n || !*n) { + log.warn("skipping PathRegex element (%d) with empty regex attribute",i); + continue; + } + + auto_ptr o(new Override(path,log,this)); + + const XMLCh* flag=path->getAttributeNS(NULL,ignoreCase); + try { + auto_ptr re( + new RegularExpression(n, (flag && (*flag==chLatin_f || *flag==chDigit_0)) ? &chNull : ignoreOption) + ); + m_regexps.push_back(make_pair(re.release(), o.release())); + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + log.error("caught exception while parsing PathRegex regular expression (%d): %s", i, tmp.get()); + throw ConfigurationException("Invalid regular expression in PathRegex element."); + } + + if (log.isDebugEnabled()) + log.debug("added mapping (%s)", m_regexps.back().second->getString("regex").second); + } + } + + // Handle nested Querys. + path = XMLHelper::getFirstChildElement(e,Query); + for (int i=1; path; ++i, path=XMLHelper::getNextSiblingElement(path,Query)) { + const XMLCh* n=path->getAttributeNS(NULL,name); + if (!n || !*n) { + log.warn("skipping Query element (%d) with empty name attribute",i); + continue; + } + auto_ptr_char ntemp(n); + const XMLCh* v=path->getAttributeNS(NULL,regex); + + auto_ptr o(new Override(path,log,this)); + try { + RegularExpression* re = NULL; + if (v && *v) + re = new RegularExpression(v); + m_queries.push_back(make_pair(make_pair(string(ntemp.get()),re), o.release())); + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + log.error("caught exception while parsing Query regular expression (%d): %s", i, tmp.get()); + throw ConfigurationException("Invalid regular expression in Query element."); + } + + log.debug("added mapping (%s)", ntemp.get()); + } + } + catch (exception&) { + delete m_acl; + for_each(m_map.begin(),m_map.end(),xmltooling::cleanup_pair()); + for (vector< pair >::iterator i = m_regexps.begin(); i != m_regexps.end(); ++i) { + delete i->first; + delete i->second; + } + for (vector< pair< pair,Override*> >::iterator j = m_queries.begin(); j != m_queries.end(); ++j) { + delete j->first.second; + delete j->second; + } + throw; + } +} + +Override::~Override() +{ + delete m_acl; + for_each(m_map.begin(),m_map.end(),xmltooling::cleanup_pair()); + for (vector< pair >::iterator i = m_regexps.begin(); i != m_regexps.end(); ++i) { + delete i->first; + delete i->second; + } + for (vector< pair< pair,Override*> >::iterator j = m_queries.begin(); j != m_queries.end(); ++j) { + delete j->first.second; + delete j->second; + } +} + +const Override* Override::locate(const HTTPRequest& request) const +{ + // This function is confusing because it's *not* recursive. + // The whole path is tokenized and mapped in a loop, so the + // path parameter starts with the entire request path and + // we can skip the leading slash as irrelevant. + const char* path = request.getRequestURI(); + if (*path == '/') + path++; + + // Now we copy the path, chop the query string, and lower case it. + char* dup=strdup(path); + char* sep=strchr(dup,'?'); + if (sep) + *sep=0; + for (char* pch=dup; *pch; pch++) + *pch=tolower(*pch); + + // Default is for the current object to provide settings. + const Override* o=this; + + // Tokenize the path by segment and try and map each segment. +#ifdef HAVE_STRTOK_R + char* pos=NULL; + const char* token=strtok_r(dup,"/",&pos); +#else + const char* token=strtok(dup,"/"); +#endif + while (token) { + map::const_iterator i=o->m_map.find(token); + if (i==o->m_map.end()) + break; // Once there's no match, we've consumed as much of the path as possible here. + // We found a match, so reset the settings pointer. + o=i->second; + + // We descended a step down the path, so we need to advance the original + // parameter for the regex step later. + path += strlen(token); + if (*path == '/') + path++; + + // Get the next segment, if any. +#ifdef HAVE_STRTOK_R + token=strtok_r(NULL,"/",&pos); +#else + token=strtok(NULL,"/"); +#endif + } + + free(dup); + + // If there's anything left, we try for a regex match on the rest of the path minus the query string. + if (*path) { + string path2(path); + path2 = path2.substr(0,path2.find('?')); + + for (vector< pair >::const_iterator re = o->m_regexps.begin(); re != o->m_regexps.end(); ++re) { + if (re->first->matches(path2.c_str())) { + o = re->second; + break; + } + } + } + + // Finally, check for query string matches. This is another "unrolled" recursive descent in a loop. + bool descended; + do { + descended = false; + for (vector< pair< pair,Override*> >::const_iterator q = o->m_queries.begin(); !descended && q != o->m_queries.end(); ++q) { + vector vals; + if (request.getParameters(q->first.first.c_str(), vals)) { + if (q->first.second) { + // We have to match one of the values. + for (vector::const_iterator v = vals.begin(); v != vals.end(); ++v) { + if (q->first.second->matches(*v)) { + o = q->second; + descended = true; + break; + } + } + } + else { + // The simple presence of the parameter is sufficient to match. + o = q->second; + descended = true; + } + } + } + } while (descended); + + return o; +} + +XMLRequestMapperImpl::XMLRequestMapperImpl(const DOMElement* e, Category& log) : m_document(NULL) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("XMLRequestMapperImpl"); +#endif + + // Load the property set. + load(e,NULL,this); + + // Load any AccessControl provider. + loadACL(e,log); + + // Loop over the HostRegex elements. + const DOMElement* host = XMLHelper::getFirstChildElement(e,HostRegex); + for (int i=1; host; ++i, host=XMLHelper::getNextSiblingElement(host,HostRegex)) { + const XMLCh* n=host->getAttributeNS(NULL,regex); + if (!n || !*n) { + log.warn("Skipping HostRegex element (%d) with empty regex attribute",i); + continue; + } + + auto_ptr o(new Override(host,log,this)); + + const XMLCh* flag=host->getAttributeNS(NULL,ignoreCase); + try { + auto_ptr re( + new RegularExpression(n, (flag && (*flag==chLatin_f || *flag==chDigit_0)) ? &chNull : ignoreOption) + ); + m_regexps.push_back(make_pair(re.release(), o.release())); + } + catch (XMLException& ex) { + auto_ptr_char tmp(ex.getMessage()); + log.error("caught exception while parsing HostRegex regular expression (%d): %s", i, tmp.get()); + } + + log.debug("Added mapping for %s", m_regexps.back().second->getString("regex").second); + } + + // Loop over the Host elements. + host = XMLHelper::getFirstChildElement(e,Host); + for (int i=1; host; ++i, host=XMLHelper::getNextSiblingElement(host,Host)) { + const XMLCh* n=host->getAttributeNS(NULL,name); + if (!n || !*n) { + log.warn("Skipping Host element (%d) with empty name attribute",i); + continue; + } + + Override* o=new Override(host,log,this); + pair name=o->getString("name"); + pair scheme=o->getString("scheme"); + pair port=o->getString("port"); + + char* dup=strdup(name.second); + for (char* pch=dup; *pch; pch++) + *pch=tolower(*pch); + auto_ptr dupwrap(dup); + + if (!scheme.first && port.first) { + // No scheme, but a port, so assume http. + scheme = pair(true,"http"); + } + else if (scheme.first && !port.first) { + // Scheme, no port, so default it. + // XXX Use getservbyname instead? + port.first = true; + if (!strcmp(scheme.second,"http")) + port.second = "80"; + else if (!strcmp(scheme.second,"https")) + port.second = "443"; + else if (!strcmp(scheme.second,"ftp")) + port.second = "21"; + else if (!strcmp(scheme.second,"ldap")) + port.second = "389"; + else if (!strcmp(scheme.second,"ldaps")) + port.second = "636"; + } + + if (scheme.first) { + string url(scheme.second); + url=url + "://" + dup; + + // Is this the default port? + if ((!strcmp(scheme.second,"http") && !strcmp(port.second,"80")) || + (!strcmp(scheme.second,"https") && !strcmp(port.second,"443")) || + (!strcmp(scheme.second,"ftp") && !strcmp(port.second,"21")) || + (!strcmp(scheme.second,"ldap") && !strcmp(port.second,"389")) || + (!strcmp(scheme.second,"ldaps") && !strcmp(port.second,"636"))) { + // First store a port-less version. + if (m_map.count(url) || m_extras.count(url)) { + log.warn("Skipping duplicate Host element (%s)",url.c_str()); + delete o; + continue; + } + m_map[url]=o; + log.debug("Added mapping for %s",url.c_str()); + + // Now append the port. We use the extras vector, to avoid double freeing the object later. + url=url + ':' + port.second; + m_extras[url]=o; + log.debug("Added mapping for %s",url.c_str()); + } + else { + url=url + ':' + port.second; + if (m_map.count(url) || m_extras.count(url)) { + log.warn("Skipping duplicate Host element (%s)",url.c_str()); + delete o; + continue; + } + m_map[url]=o; + log.debug("Added mapping for %s",url.c_str()); + } + } + else { + // No scheme or port, so we enter dual hosts on http:80 and https:443 + string url("http://"); + url = url + dup; + if (m_map.count(url) || m_extras.count(url)) { + log.warn("Skipping duplicate Host element (%s)",url.c_str()); + delete o; + continue; + } + m_map[url]=o; + log.debug("Added mapping for %s",url.c_str()); + + url = url + ":80"; + if (m_map.count(url) || m_extras.count(url)) { + log.warn("Skipping duplicate Host element (%s)",url.c_str()); + continue; + } + m_extras[url]=o; + log.debug("Added mapping for %s",url.c_str()); + + url = "https://"; + url = url + dup; + if (m_map.count(url) || m_extras.count(url)) { + log.warn("Skipping duplicate Host element (%s)",url.c_str()); + continue; + } + m_extras[url]=o; + log.debug("Added mapping for %s",url.c_str()); + + url = url + ":443"; + if (m_map.count(url) || m_extras.count(url)) { + log.warn("Skipping duplicate Host element (%s)",url.c_str()); + continue; + } + m_extras[url]=o; + log.debug("Added mapping for %s",url.c_str()); + } + } +} + +const Override* XMLRequestMapperImpl::findOverride(const char* vhost, const HTTPRequest& request) const +{ + const Override* o=NULL; + map::const_iterator i=m_map.find(vhost); + if (i!=m_map.end()) + o=i->second; + else { + i=m_extras.find(vhost); + if (i!=m_extras.end()) + o=i->second; + else { + for (vector< pair >::const_iterator re = m_regexps.begin(); !o && re != m_regexps.end(); ++re) { + if (re->first->matches(vhost)) + o=re->second; + } + } + } + + return o ? o->locate(request) : this; +} + +pair XMLRequestMapper::load() +{ + // Load from source using base class. + pair raw = ReloadableXMLFile::load(); + + // If we own it, wrap it. + XercesJanitor docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL); + + XMLRequestMapperImpl* impl = new XMLRequestMapperImpl(raw.second,m_log); + + // If we held the document, transfer it to the impl. If we didn't, it's a no-op. + impl->setDocument(docjanitor.release()); + + delete m_impl; + m_impl = impl; + + return make_pair(false,(DOMElement*)NULL); +} + +RequestMapper::Settings XMLRequestMapper::getSettings(const HTTPRequest& request) const +{ + ostringstream vhost; + vhost << request.getScheme() << "://" << request.getHostname() << ':' << request.getPort(); + + const Override* o=m_impl->findOverride(vhost.str().c_str(), request); + + if (m_log.isDebugEnabled()) { +#ifdef _DEBUG + xmltooling::NDC ndc("getSettings"); +#endif + pair ret=o->getString("applicationId"); + m_log.debug("mapped %s%s to %s", vhost.str().c_str(), request.getRequestURI() ? request.getRequestURI() : "", ret.second); + } + + return Settings(o,o->getAC()); +} diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp new file mode 100644 index 0000000..eeb3f38 --- /dev/null +++ b/shibsp/impl/XMLServiceProvider.cpp @@ -0,0 +1,1504 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * XMLServiceProvider.cpp + * + * XML-based SP configuration and mgmt + */ + +#include "internal.h" +#include "exceptions.h" +#include "AccessControl.h" +#include "Application.h" +#include "RequestMapper.h" +#include "ServiceProvider.h" +#include "SessionCache.h" +#include "SPConfig.h" +#include "handler/SessionInitiator.h" +#include "remoting/ListenerService.h" +#include "util/DOMPropertySet.h" +#include "util/SPConstants.h" + +#if defined(XMLTOOLING_LOG4SHIB) +# include +#elif defined(XMLTOOLING_LOG4CPP) +# include +#else +# error "Supported logging library not available." +#endif +#include +#include +#include +#include +#include + +#ifndef SHIBSP_LITE +# include "TransactionLog.h" +# include "attribute/filtering/AttributeFilter.h" +# include "attribute/resolver/AttributeExtractor.h" +# include "attribute/resolver/AttributeResolver.h" +# include "security/PKIXTrustEngine.h" +# include +# include +# include +# include +# include +# include +# include +# include +using namespace opensaml::saml2; +using namespace opensaml::saml2p; +using namespace opensaml::saml2md; +using namespace opensaml; +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +namespace { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + + static vector g_noHandlers; + + // Application configuration wrapper + class SHIBSP_DLLLOCAL XMLApplication : public Application, public Remoted, public DOMPropertySet, public DOMNodeFilter + { + public: + XMLApplication(const ServiceProvider*, const DOMElement* e, const XMLApplication* base=NULL); + ~XMLApplication() { cleanup(); } + + const char* getHash() const {return m_hash.c_str();} + +#ifndef SHIBSP_LITE + SAMLArtifact* generateSAML1Artifact(const EntityDescriptor* relyingParty) const { + throw ConfigurationException("No support for SAML 1.x artifact generation."); + } + SAML2Artifact* generateSAML2Artifact(const EntityDescriptor* relyingParty) const { + pair index = make_pair(false,0); + const PropertySet* props = getRelyingParty(relyingParty); + index = props->getInt("artifactEndpointIndex"); + if (!index.first) + index = getArtifactEndpointIndex(); + return new SAML2ArtifactType0004(SAMLConfig::getConfig().hashSHA1(props->getString("entityID").second),index.first ? index.second : 1); + } + + MetadataProvider* getMetadataProvider(bool required=true) const { + if (required && !m_base && !m_metadata) + throw ConfigurationException("No MetadataProvider available."); + return (!m_metadata && m_base) ? m_base->getMetadataProvider() : m_metadata; + } + TrustEngine* getTrustEngine(bool required=true) const { + if (required && !m_base && !m_trust) + throw ConfigurationException("No TrustEngine available."); + return (!m_trust && m_base) ? m_base->getTrustEngine() : m_trust; + } + AttributeExtractor* getAttributeExtractor() const { + return (!m_attrExtractor && m_base) ? m_base->getAttributeExtractor() : m_attrExtractor; + } + AttributeFilter* getAttributeFilter() const { + return (!m_attrFilter && m_base) ? m_base->getAttributeFilter() : m_attrFilter; + } + AttributeResolver* getAttributeResolver() const { + return (!m_attrResolver && m_base) ? m_base->getAttributeResolver() : m_attrResolver; + } + CredentialResolver* getCredentialResolver() const { + return (!m_credResolver && m_base) ? m_base->getCredentialResolver() : m_credResolver; + } + const PropertySet* getRelyingParty(const EntityDescriptor* provider) const; + const vector* getAudiences() const { + return (m_audiences.empty() && m_base) ? m_base->getAudiences() : &m_audiences; + } +#endif + string getNotificationURL(const char* resource, bool front, unsigned int index) const; + + const vector& getRemoteUserAttributeIds() const { + return (m_remoteUsers.empty() && m_base) ? m_base->getRemoteUserAttributeIds() : m_remoteUsers; + } + + const SessionInitiator* getDefaultSessionInitiator() const; + const SessionInitiator* getSessionInitiatorById(const char* id) const; + const Handler* getDefaultAssertionConsumerService() const; + const Handler* getAssertionConsumerServiceByIndex(unsigned short index) const; + const vector& getAssertionConsumerServicesByBinding(const XMLCh* binding) const; + const Handler* getHandler(const char* path) const; + void getHandlers(vector& handlers) const; + + void receive(DDF& in, ostream& out) { + // Only current function is to return the headers to clear. + DDF header; + DDF ret=DDF(NULL).list(); + DDFJanitor jret(ret); + for (vector< pair >::const_iterator i = m_unsetHeaders.begin(); i!=m_unsetHeaders.end(); ++i) { + header = DDF(i->first.c_str()).string(i->second.c_str()); + ret.add(header); + } + out << ret; + } + + // Provides filter to exclude special config elements. + short acceptNode(const DOMNode* node) const; + + private: + void cleanup(); + const XMLApplication* m_base; + string m_hash; +#ifndef SHIBSP_LITE + MetadataProvider* m_metadata; + TrustEngine* m_trust; + AttributeExtractor* m_attrExtractor; + AttributeFilter* m_attrFilter; + AttributeResolver* m_attrResolver; + CredentialResolver* m_credResolver; + vector m_audiences; + + // RelyingParty properties +#ifdef HAVE_GOOD_STL + map m_partyMap; +#else + map m_partyMap; +#endif +#endif + vector m_remoteUsers,m_frontLogout,m_backLogout; + + // manage handler objects + vector m_handlers; + + // maps location (path info) to applicable handlers + map m_handlerMap; + + // maps unique indexes to consumer services + map m_acsIndexMap; + + // pointer to default consumer service + const Handler* m_acsDefault; + + // maps binding strings to supporting consumer service(s) +#ifdef HAVE_GOOD_STL + typedef map > ACSBindingMap; +#else + typedef map > ACSBindingMap; +#endif + ACSBindingMap m_acsBindingMap; + + // pointer to default session initiator + const SessionInitiator* m_sessionInitDefault; + + // maps unique ID strings to session initiators + map m_sessionInitMap; + + // pointer to default artifact resolution service + const Handler* m_artifactResolutionDefault; + + pair getArtifactEndpointIndex() const { + if (m_artifactResolutionDefault) return m_artifactResolutionDefault->getInt("index"); + return m_base ? m_base->getArtifactEndpointIndex() : make_pair(false,0); + } + }; + + // Top-level configuration implementation + class SHIBSP_DLLLOCAL XMLConfig; + class SHIBSP_DLLLOCAL XMLConfigImpl : public DOMPropertySet, public DOMNodeFilter + { + public: + XMLConfigImpl(const DOMElement* e, bool first, const XMLConfig* outer, Category& log); + ~XMLConfigImpl(); + + RequestMapper* m_requestMapper; + map m_appmap; +#ifndef SHIBSP_LITE + map< string,pair< PropertySet*,vector > > m_policyMap; + vector< pair< string, pair > > m_transportOptions; +#endif + + // Provides filter to exclude special config elements. + short acceptNode(const DOMNode* node) const; + + void setDocument(DOMDocument* doc) { + m_document = doc; + } + + private: + void doExtensions(const DOMElement* e, const char* label, Category& log); + void cleanup(); + + const XMLConfig* m_outer; + DOMDocument* m_document; + }; + + class SHIBSP_DLLLOCAL XMLConfig : public ServiceProvider, public ReloadableXMLFile +#ifndef SHIBSP_LITE + ,public Remoted +#endif + { + public: + XMLConfig(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".Config")), + m_impl(NULL), m_listener(NULL), m_sessionCache(NULL) +#ifndef SHIBSP_LITE + , m_tranLog(NULL) +#endif + { + } + + void init() { + load(); + } + + ~XMLConfig() { + delete m_impl; + delete m_sessionCache; + delete m_listener; +#ifndef SHIBSP_LITE + delete m_tranLog; + SAMLConfig::getConfig().setArtifactMap(NULL); + XMLToolingConfig::getConfig().setReplayCache(NULL); + for_each(m_storage.begin(), m_storage.end(), cleanup_pair()); +#endif + } + + // PropertySet + const PropertySet* getParent() const { return m_impl->getParent(); } + void setParent(const PropertySet* parent) {return m_impl->setParent(parent);} + pair getBool(const char* name, const char* ns=NULL) const {return m_impl->getBool(name,ns);} + pair getString(const char* name, const char* ns=NULL) const {return m_impl->getString(name,ns);} + pair getXMLString(const char* name, const char* ns=NULL) const {return m_impl->getXMLString(name,ns);} + pair getUnsignedInt(const char* name, const char* ns=NULL) const {return m_impl->getUnsignedInt(name,ns);} + pair getInt(const char* name, const char* ns=NULL) const {return m_impl->getInt(name,ns);} + void getAll(map& properties) const {return m_impl->getAll(properties);} + const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:2.0:native:sp:config") const {return m_impl->getPropertySet(name,ns);} + const DOMElement* getElement() const {return m_impl->getElement();} + + // ServiceProvider +#ifndef SHIBSP_LITE + // Remoted + void receive(DDF& in, ostream& out); + + TransactionLog* getTransactionLog() const { + if (m_tranLog) + return m_tranLog; + throw ConfigurationException("No TransactionLog available."); + } + + StorageService* getStorageService(const char* id) const { + if (id) { + map::const_iterator i=m_storage.find(id); + if (i!=m_storage.end()) + return i->second; + } + return NULL; + } +#endif + + ListenerService* getListenerService(bool required=true) const { + if (required && !m_listener) + throw ConfigurationException("No ListenerService available."); + return m_listener; + } + + SessionCache* getSessionCache(bool required=true) const { + if (required && !m_sessionCache) + throw ConfigurationException("No SessionCache available."); + return m_sessionCache; + } + + RequestMapper* getRequestMapper(bool required=true) const { + if (required && !m_impl->m_requestMapper) + throw ConfigurationException("No RequestMapper available."); + return m_impl->m_requestMapper; + } + + const Application* getApplication(const char* applicationId) const { + map::const_iterator i=m_impl->m_appmap.find(applicationId); + return (i!=m_impl->m_appmap.end()) ? i->second : NULL; + } + +#ifndef SHIBSP_LITE + const PropertySet* getPolicySettings(const char* id) const { + map > >::const_iterator i = m_impl->m_policyMap.find(id); + if (i!=m_impl->m_policyMap.end()) + return i->second.first; + throw ConfigurationException("Security Policy ($1) not found, check element.", params(1,id)); + } + + const vector& getPolicyRules(const char* id) const { + map > >::const_iterator i = m_impl->m_policyMap.find(id); + if (i!=m_impl->m_policyMap.end()) + return i->second.second; + throw ConfigurationException("Security Policy ($1) not found, check element.", params(1,id)); + } + + bool setTransportOptions(SOAPTransport& transport) const { + bool ret = true; + vector< pair< string, pair > >::const_iterator opt; + for (opt = m_impl->m_transportOptions.begin(); opt != m_impl->m_transportOptions.end(); ++opt) { + if (!transport.setProviderOption(opt->first.c_str(), opt->second.first.c_str(), opt->second.second.c_str())) { + m_log.error("failed to set SOAPTransport option (%s)", opt->second.first.c_str()); + ret = false; + } + } + return ret; + } +#endif + + protected: + pair load(); + + private: + friend class XMLConfigImpl; + XMLConfigImpl* m_impl; + mutable ListenerService* m_listener; + mutable SessionCache* m_sessionCache; +#ifndef SHIBSP_LITE + mutable TransactionLog* m_tranLog; + mutable map m_storage; +#endif + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + static const XMLCh ApplicationOverride[] = UNICODE_LITERAL_19(A,p,p,l,i,c,a,t,i,o,n,O,v,e,r,r,i,d,e); + static const XMLCh ApplicationDefaults[] = UNICODE_LITERAL_19(A,p,p,l,i,c,a,t,i,o,n,D,e,f,a,u,l,t,s); + static const XMLCh _ArtifactMap[] = UNICODE_LITERAL_11(A,r,t,i,f,a,c,t,M,a,p); + static const XMLCh _AttributeExtractor[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,E,x,t,r,a,c,t,o,r); + static const XMLCh _AttributeFilter[] = UNICODE_LITERAL_15(A,t,t,r,i,b,u,t,e,F,i,l,t,e,r); + static const XMLCh _AttributeResolver[] = UNICODE_LITERAL_17(A,t,t,r,i,b,u,t,e,R,e,s,o,l,v,e,r); + static const XMLCh _AssertionConsumerService[] = UNICODE_LITERAL_24(A,s,s,e,r,t,i,o,n,C,o,n,s,u,m,e,r,S,e,r,v,i,c,e); + static const XMLCh _ArtifactResolutionService[] =UNICODE_LITERAL_25(A,r,t,i,f,a,c,t,R,e,s,o,l,u,t,i,o,n,S,e,r,v,i,c,e); + static const XMLCh _Audience[] = UNICODE_LITERAL_8(A,u,d,i,e,n,c,e); + static const XMLCh Binding[] = UNICODE_LITERAL_7(B,i,n,d,i,n,g); + static const XMLCh Channel[]= UNICODE_LITERAL_7(C,h,a,n,n,e,l); + static const XMLCh _CredentialResolver[] = UNICODE_LITERAL_18(C,r,e,d,e,n,t,i,a,l,R,e,s,o,l,v,e,r); + static const XMLCh _Extensions[] = UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s); + static const XMLCh _fatal[] = UNICODE_LITERAL_5(f,a,t,a,l); + static const XMLCh _Handler[] = UNICODE_LITERAL_7(H,a,n,d,l,e,r); + static const XMLCh _id[] = UNICODE_LITERAL_2(i,d); + static const XMLCh InProcess[] = UNICODE_LITERAL_9(I,n,P,r,o,c,e,s,s); + static const XMLCh Library[] = UNICODE_LITERAL_7(L,i,b,r,a,r,y); + static const XMLCh Listener[] = UNICODE_LITERAL_8(L,i,s,t,e,n,e,r); + static const XMLCh Location[] = UNICODE_LITERAL_8(L,o,c,a,t,i,o,n); + static const XMLCh logger[] = UNICODE_LITERAL_6(l,o,g,g,e,r); + static const XMLCh _LogoutInitiator[] = UNICODE_LITERAL_15(L,o,g,o,u,t,I,n,i,t,i,a,t,o,r); + static const XMLCh _ManageNameIDService[] = UNICODE_LITERAL_19(M,a,n,a,g,e,N,a,m,e,I,D,S,e,r,v,i,c,e); + static const XMLCh _MetadataProvider[] = UNICODE_LITERAL_16(M,e,t,a,d,a,t,a,P,r,o,v,i,d,e,r); + static const XMLCh Notify[] = UNICODE_LITERAL_6(N,o,t,i,f,y); + static const XMLCh _option[] = UNICODE_LITERAL_6(o,p,t,i,o,n); + static const XMLCh OutOfProcess[] = UNICODE_LITERAL_12(O,u,t,O,f,P,r,o,c,e,s,s); + static const XMLCh _path[] = UNICODE_LITERAL_4(p,a,t,h); + static const XMLCh Policy[] = UNICODE_LITERAL_6(P,o,l,i,c,y); + static const XMLCh _provider[] = UNICODE_LITERAL_8(p,r,o,v,i,d,e,r); + static const XMLCh RelyingParty[] = UNICODE_LITERAL_12(R,e,l,y,i,n,g,P,a,r,t,y); + static const XMLCh _ReplayCache[] = UNICODE_LITERAL_11(R,e,p,l,a,y,C,a,c,h,e); + static const XMLCh _RequestMapper[] = UNICODE_LITERAL_13(R,e,q,u,e,s,t,M,a,p,p,e,r); + static const XMLCh Rule[] = UNICODE_LITERAL_4(R,u,l,e); + static const XMLCh SecurityPolicies[] = UNICODE_LITERAL_16(S,e,c,u,r,i,t,y,P,o,l,i,c,i,e,s); + static const XMLCh _SessionCache[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,C,a,c,h,e); + static const XMLCh _SessionInitiator[] = UNICODE_LITERAL_16(S,e,s,s,i,o,n,I,n,i,t,i,a,t,o,r); + static const XMLCh _SingleLogoutService[] = UNICODE_LITERAL_19(S,i,n,g,l,e,L,o,g,o,u,t,S,e,r,v,i,c,e); + static const XMLCh Site[] = UNICODE_LITERAL_4(S,i,t,e); + static const XMLCh _StorageService[] = UNICODE_LITERAL_14(S,t,o,r,a,g,e,S,e,r,v,i,c,e); + static const XMLCh TCPListener[] = UNICODE_LITERAL_11(T,C,P,L,i,s,t,e,n,e,r); + static const XMLCh TransportOption[] = UNICODE_LITERAL_15(T,r,a,n,s,p,o,r,t,O,p,t,i,o,n); + static const XMLCh _TrustEngine[] = UNICODE_LITERAL_11(T,r,u,s,t,E,n,g,i,n,e); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + static const XMLCh UnixListener[] = UNICODE_LITERAL_12(U,n,i,x,L,i,s,t,e,n,e,r); + +#ifndef SHIBSP_LITE + class SHIBSP_DLLLOCAL PolicyNodeFilter : public DOMNodeFilter + { + public: + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + }; +#endif +}; + +namespace shibsp { + ServiceProvider* XMLServiceProviderFactory(const DOMElement* const & e) + { + return new XMLConfig(e); + } +}; + +XMLApplication::XMLApplication( + const ServiceProvider* sp, + const DOMElement* e, + const XMLApplication* base + ) : Application(sp), m_base(base), +#ifndef SHIBSP_LITE + m_metadata(NULL), m_trust(NULL), + m_attrExtractor(NULL), m_attrFilter(NULL), m_attrResolver(NULL), + m_credResolver(NULL), +#endif + m_acsDefault(NULL), m_sessionInitDefault(NULL), m_artifactResolutionDefault(NULL) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("XMLApplication"); +#endif + Category& log=Category::getInstance(SHIBSP_LOGCAT".Application"); + + try { + // First load any property sets. + load(e,NULL,this); + if (base) + setParent(base); + + SPConfig& conf=SPConfig::getConfig(); +#ifndef SHIBSP_LITE + SAMLConfig& samlConf=SAMLConfig::getConfig(); + XMLToolingConfig& xmlConf=XMLToolingConfig::getConfig(); +#endif + + // This used to be an actual hash, but now it's just a hex-encode to avoid xmlsec. + static char DIGITS[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + string tohash=getId(); + tohash+=getString("entityID").second; + for (const char* ch = tohash.c_str(); *ch; ++ch) { + m_hash += (DIGITS[((unsigned char)(0xF0 & *ch)) >> 4 ]); + m_hash += (DIGITS[0x0F & *ch]); + } + + // Load attribute ID lists for REMOTE_USER and header clearing. + if (conf.isEnabled(SPConfig::InProcess)) { + pair attributes = getString("REMOTE_USER"); + if (attributes.first) { + char* dup = strdup(attributes.second); + char* pos; + char* start = dup; + while (start && *start) { + while (*start && isspace(*start)) + start++; + if (!*start) + break; + pos = strchr(start,' '); + if (pos) + *pos=0; + m_remoteUsers.push_back(start); + start = pos ? pos+1 : NULL; + } + free(dup); + } + + attributes = getString("unsetHeaders"); + if (attributes.first) { + string transformedprefix("HTTP_"); + const char* pch; + pair prefix = getString("metadataAttributePrefix"); + if (prefix.first) { + pch = prefix.second; + while (*pch) { + transformedprefix += (isalnum(*pch) ? toupper(*pch) : '_'); + pch++; + } + } + char* dup = strdup(attributes.second); + char* pos; + char* start = dup; + while (start && *start) { + while (*start && isspace(*start)) + start++; + if (!*start) + break; + pos = strchr(start,' '); + if (pos) + *pos=0; + + string transformed; + pch = start; + while (*pch) { + transformed += (isalnum(*pch) ? toupper(*pch) : '_'); + pch++; + } + m_unsetHeaders.push_back(pair(start,string("HTTP_") + transformed)); + if (prefix.first) + m_unsetHeaders.push_back(pair(string(prefix.second) + start, transformedprefix + transformed)); + start = pos ? pos+1 : NULL; + } + free(dup); + m_unsetHeaders.push_back(pair("Shib-Application-ID","HTTP_SHIB_APPLICATION_ID")); + } + } + + Handler* handler=NULL; + const PropertySet* sessions = getPropertySet("Sessions"); + + // Process assertion export handler. + pair location = sessions ? sessions->getString("exportLocation") : pair(false,NULL); + if (location.first) { + try { + DOMElement* exportElement = e->getOwnerDocument()->createElementNS(shibspconstants::SHIB2SPCONFIG_NS,_Handler); + exportElement->setAttributeNS(NULL,Location,sessions->getXMLString("exportLocation").second); + pair exportACL = sessions->getXMLString("exportACL"); + if (exportACL.first) { + static const XMLCh _acl[] = UNICODE_LITERAL_9(e,x,p,o,r,t,A,C,L); + exportElement->setAttributeNS(NULL,_acl,exportACL.second); + } + handler = conf.HandlerManager.newPlugin( + samlconstants::SAML20_BINDING_URI, pair(exportElement, getId()) + ); + m_handlers.push_back(handler); + + // Insert into location map. If it contains the handlerURL, we skip past that part. + const char* pch = strstr(location.second, sessions->getString("handlerURL").second); + if (pch) + location.second = pch + strlen(sessions->getString("handlerURL").second); + if (*location.second == '/') + m_handlerMap[location.second]=handler; + else + m_handlerMap[string("/") + location.second]=handler; + } + catch (exception& ex) { + log.error("caught exception installing assertion lookup handler: %s", ex.what()); + } + } + + // Process other handlers. + bool hardACS=false, hardSessionInit=false, hardArt=false; + const DOMElement* child = sessions ? XMLHelper::getFirstChildElement(sessions->getElement()) : NULL; + while (child) { + try { + // A handler is based on the Binding property in conjunction with the element name. + // If it's an ACS or SI, also handle index/id mappings and defaulting. + if (XMLString::equals(child->getLocalName(),_AssertionConsumerService)) { + auto_ptr_char bindprop(child->getAttributeNS(NULL,Binding)); + if (!bindprop.get() || !*(bindprop.get())) { + log.warn("md:AssertionConsumerService element has no Binding attribute, skipping it..."); + child = XMLHelper::getNextSiblingElement(child); + continue; + } + handler=conf.AssertionConsumerServiceManager.newPlugin(bindprop.get(),make_pair(child, getId())); + // Map by binding (may be > 1 per binding, e.g. SAML 1.0 vs 1.1) +#ifdef HAVE_GOOD_STL + m_acsBindingMap[handler->getXMLString("Binding").second].push_back(handler); +#else + m_acsBindingMap[handler->getString("Binding").second].push_back(handler); +#endif + m_acsIndexMap[handler->getUnsignedInt("index").second]=handler; + + if (!hardACS) { + pair defprop=handler->getBool("isDefault"); + if (defprop.first) { + if (defprop.second) { + hardACS=true; + m_acsDefault=handler; + } + } + else if (!m_acsDefault) + m_acsDefault=handler; + } + } + else if (XMLString::equals(child->getLocalName(),_SessionInitiator)) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + if (!type.get() || !*(type.get())) { + log.warn("SessionInitiator element has no type attribute, skipping it..."); + child = XMLHelper::getNextSiblingElement(child); + continue; + } + SessionInitiator* sihandler=conf.SessionInitiatorManager.newPlugin(type.get(),make_pair(child, getId())); + handler=sihandler; + pair si_id=handler->getString("id"); + if (si_id.first && si_id.second) + m_sessionInitMap[si_id.second]=sihandler; + if (!hardSessionInit) { + pair defprop=handler->getBool("isDefault"); + if (defprop.first) { + if (defprop.second) { + hardSessionInit=true; + m_sessionInitDefault=sihandler; + } + } + else if (!m_sessionInitDefault) + m_sessionInitDefault=sihandler; + } + } + else if (XMLString::equals(child->getLocalName(),_LogoutInitiator)) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + if (!type.get() || !*(type.get())) { + log.warn("LogoutInitiator element has no type attribute, skipping it..."); + child = XMLHelper::getNextSiblingElement(child); + continue; + } + handler=conf.LogoutInitiatorManager.newPlugin(type.get(),make_pair(child, getId())); + } + else if (XMLString::equals(child->getLocalName(),_ArtifactResolutionService)) { + auto_ptr_char bindprop(child->getAttributeNS(NULL,Binding)); + if (!bindprop.get() || !*(bindprop.get())) { + log.warn("md:ArtifactResolutionService element has no Binding attribute, skipping it..."); + child = XMLHelper::getNextSiblingElement(child); + continue; + } + handler=conf.ArtifactResolutionServiceManager.newPlugin(bindprop.get(),make_pair(child, getId())); + + if (!hardArt) { + pair defprop=handler->getBool("isDefault"); + if (defprop.first) { + if (defprop.second) { + hardArt=true; + m_artifactResolutionDefault=handler; + } + } + else if (!m_artifactResolutionDefault) + m_artifactResolutionDefault=handler; + } + } + else if (XMLString::equals(child->getLocalName(),_SingleLogoutService)) { + auto_ptr_char bindprop(child->getAttributeNS(NULL,Binding)); + if (!bindprop.get() || !*(bindprop.get())) { + log.warn("md:SingleLogoutService element has no Binding attribute, skipping it..."); + child = XMLHelper::getNextSiblingElement(child); + continue; + } + handler=conf.SingleLogoutServiceManager.newPlugin(bindprop.get(),make_pair(child, getId())); + } + else if (XMLString::equals(child->getLocalName(),_ManageNameIDService)) { + auto_ptr_char bindprop(child->getAttributeNS(NULL,Binding)); + if (!bindprop.get() || !*(bindprop.get())) { + log.warn("md:ManageNameIDService element has no Binding attribute, skipping it..."); + child = XMLHelper::getNextSiblingElement(child); + continue; + } + handler=conf.ManageNameIDServiceManager.newPlugin(bindprop.get(),make_pair(child, getId())); + } + else { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + if (!type.get() || !*(type.get())) { + log.warn("Handler element has no type attribute, skipping it..."); + child = XMLHelper::getNextSiblingElement(child); + continue; + } + handler=conf.HandlerManager.newPlugin(type.get(),make_pair(child, getId())); + } + + m_handlers.push_back(handler); + + // Insert into location map. + location=handler->getString("Location"); + if (location.first && *location.second == '/') + m_handlerMap[location.second]=handler; + else if (location.first) + m_handlerMap[string("/") + location.second]=handler; + + } + catch (exception& ex) { + log.error("caught exception processing handler element: %s", ex.what()); + } + + child = XMLHelper::getNextSiblingElement(child); + } + + // Notification. + DOMNodeList* nlist=e->getElementsByTagNameNS(shibspconstants::SHIB2SPCONFIG_NS,Notify); + for (XMLSize_t i=0; nlist && igetLength(); i++) { + if (nlist->item(i)->getParentNode()->isSameNode(e)) { + const XMLCh* channel = static_cast(nlist->item(i))->getAttributeNS(NULL,Channel); + auto_ptr_char loc(static_cast(nlist->item(i))->getAttributeNS(NULL,Location)); + if (loc.get() && *loc.get()) { + if (channel && *channel == chLatin_f) + m_frontLogout.push_back(loc.get()); + else + m_backLogout.push_back(loc.get()); + } + } + } + +#ifndef SHIBSP_LITE + nlist=e->getElementsByTagNameNS(samlconstants::SAML20_NS,Audience::LOCAL_NAME); + for (XMLSize_t i=0; nlist && igetLength(); i++) + if (nlist->item(i)->getParentNode()->isSameNode(e) && nlist->item(i)->hasChildNodes()) + m_audiences.push_back(nlist->item(i)->getFirstChild()->getNodeValue()); + + if (conf.isEnabled(SPConfig::Metadata)) { + child = XMLHelper::getFirstChildElement(e,_MetadataProvider); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building MetadataProvider of type %s...",type.get()); + try { + auto_ptr mp(samlConf.MetadataProviderManager.newPlugin(type.get(),child)); + mp->init(); + m_metadata = mp.release(); + } + catch (exception& ex) { + log.crit("error building/initializing MetadataProvider: %s", ex.what()); + } + } + } + + if (conf.isEnabled(SPConfig::Trust)) { + child = XMLHelper::getFirstChildElement(e,_TrustEngine); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building TrustEngine of type %s...",type.get()); + try { + m_trust = xmlConf.TrustEngineManager.newPlugin(type.get(),child); + } + catch (exception& ex) { + log.crit("error building TrustEngine: %s", ex.what()); + } + } + } + + if (conf.isEnabled(SPConfig::AttributeResolution)) { + child = XMLHelper::getFirstChildElement(e,_AttributeExtractor); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building AttributeExtractor of type %s...",type.get()); + try { + m_attrExtractor = conf.AttributeExtractorManager.newPlugin(type.get(),child); + } + catch (exception& ex) { + log.crit("error building AttributeExtractor: %s", ex.what()); + } + } + + child = XMLHelper::getFirstChildElement(e,_AttributeFilter); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building AttributeFilter of type %s...",type.get()); + try { + m_attrFilter = conf.AttributeFilterManager.newPlugin(type.get(),child); + } + catch (exception& ex) { + log.crit("error building AttributeFilter: %s", ex.what()); + } + } + + child = XMLHelper::getFirstChildElement(e,_AttributeResolver); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building AttributeResolver of type %s...",type.get()); + try { + m_attrResolver = conf.AttributeResolverManager.newPlugin(type.get(),child); + } + catch (exception& ex) { + log.crit("error building AttributeResolver: %s", ex.what()); + } + } + + if (m_unsetHeaders.empty()) { + vector unsetHeaders; + if (m_attrExtractor) { + Locker extlock(m_attrExtractor); + m_attrExtractor->getAttributeIds(unsetHeaders); + } + if (m_attrResolver) { + Locker reslock(m_attrResolver); + m_attrResolver->getAttributeIds(unsetHeaders); + } + if (unsetHeaders.empty()) { + if (m_base) + m_unsetHeaders.insert(m_unsetHeaders.end(), m_base->m_unsetHeaders.begin(), m_base->m_unsetHeaders.end()); + else + m_unsetHeaders.push_back(pair("Shib-Application-ID","HTTP_SHIB_APPLICATION_ID")); + } + else { + string transformedprefix("HTTP_"); + const char* pch; + pair prefix = getString("metadataAttributePrefix"); + if (prefix.first) { + pch = prefix.second; + while (*pch) { + transformedprefix += (isalnum(*pch) ? toupper(*pch) : '_'); + pch++; + } + } + for (vector::const_iterator hdr = unsetHeaders.begin(); hdr!=unsetHeaders.end(); ++hdr) { + string transformed; + pch = hdr->c_str(); + while (*pch) { + transformed += (isalnum(*pch) ? toupper(*pch) : '_'); + pch++; + } + m_unsetHeaders.push_back(pair(*hdr, string("HTTP_") + transformed)); + if (prefix.first) + m_unsetHeaders.push_back(pair(string(prefix.second) + *hdr, transformedprefix + transformed)); + } + m_unsetHeaders.push_back(pair("Shib-Application-ID","HTTP_SHIB_APPLICATION_ID")); + } + } + } + + if (conf.isEnabled(SPConfig::Credentials)) { + child = XMLHelper::getFirstChildElement(e,_CredentialResolver); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building CredentialResolver of type %s...",type.get()); + try { + m_credResolver = xmlConf.CredentialResolverManager.newPlugin(type.get(),child); + } + catch (exception& ex) { + log.crit("error building CredentialResolver: %s", ex.what()); + } + } + } + + // Finally, load relying parties. + child = XMLHelper::getFirstChildElement(e,RelyingParty); + while (child) { + auto_ptr rp(new DOMPropertySet()); + rp->load(child,NULL,this); + rp->setParent(this); + m_partyMap[child->getAttributeNS(NULL,saml2::Attribute::NAME_ATTRIB_NAME)]=rp.release(); + child = XMLHelper::getNextSiblingElement(child,RelyingParty); + } +#endif + + // Out of process only, we register a listener endpoint. + if (!conf.isEnabled(SPConfig::InProcess)) { + ListenerService* listener = sp->getListenerService(false); + if (listener) { + string addr=string(getId()) + "::getHeaders::Application"; + listener->regListener(addr.c_str(),this); + } + else + log.info("no ListenerService available, Application remoting disabled"); + } + } + catch (exception&) { + cleanup(); + throw; + } +#ifndef _DEBUG + catch (...) { + cleanup(); + throw; + } +#endif +} + +void XMLApplication::cleanup() +{ + ListenerService* listener=getServiceProvider().getListenerService(false); + if (listener && SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess) && !SPConfig::getConfig().isEnabled(SPConfig::InProcess)) { + string addr=string(getId()) + "::getHeaders::Application"; + listener->unregListener(addr.c_str(),this); + } + for_each(m_handlers.begin(),m_handlers.end(),xmltooling::cleanup()); + m_handlers.clear(); +#ifndef SHIBSP_LITE +#ifdef HAVE_GOOD_STL + for_each(m_partyMap.begin(),m_partyMap.end(),cleanup_pair()); +#else + for_each(m_partyMap.begin(),m_partyMap.end(),cleanup_pair()); +#endif + m_partyMap.clear(); + delete m_credResolver; + m_credResolver = NULL; + delete m_attrResolver; + m_attrResolver = NULL; + delete m_attrFilter; + m_attrFilter = NULL; + delete m_attrExtractor; + m_attrExtractor = NULL; + delete m_trust; + m_trust = NULL; + delete m_metadata; + m_metadata = NULL; +#endif +} + +short XMLApplication::acceptNode(const DOMNode* node) const +{ + const XMLCh* name=node->getLocalName(); + if (XMLString::equals(name,ApplicationOverride) || + XMLString::equals(name,_Audience) || + XMLString::equals(name,Notify) || + XMLString::equals(name,_Handler) || + XMLString::equals(name,_AssertionConsumerService) || + XMLString::equals(name,_ArtifactResolutionService) || + XMLString::equals(name,_LogoutInitiator) || + XMLString::equals(name,_ManageNameIDService) || + XMLString::equals(name,_SessionInitiator) || + XMLString::equals(name,_SingleLogoutService) || + XMLString::equals(name,RelyingParty) || + XMLString::equals(name,_MetadataProvider) || + XMLString::equals(name,_TrustEngine) || + XMLString::equals(name,_CredentialResolver) || + XMLString::equals(name,_AttributeFilter) || + XMLString::equals(name,_AttributeExtractor) || + XMLString::equals(name,_AttributeResolver)) + return FILTER_REJECT; + + return FILTER_ACCEPT; +} + +#ifndef SHIBSP_LITE + +const PropertySet* XMLApplication::getRelyingParty(const EntityDescriptor* provider) const +{ + if (!provider) + return this; + +#ifdef HAVE_GOOD_STL + map::const_iterator i=m_partyMap.find(provider->getEntityID()); + if (i!=m_partyMap.end()) + return i->second; + const EntitiesDescriptor* group=dynamic_cast(provider->getParent()); + while (group) { + if (group->getName()) { + i=m_partyMap.find(group->getName()); + if (i!=m_partyMap.end()) + return i->second; + } + group=dynamic_cast(group->getParent()); + } +#else + map::const_iterator i=m_partyMap.begin(); + for (; i!=m_partyMap.end(); i++) { + if (XMLString::equals(i->first,provider->getEntityID())) + return i->second; + const EntitiesDescriptor* group=dynamic_cast(provider->getParent()); + while (group) { + if (XMLString::equals(i->first,group->getName())) + return i->second; + group=dynamic_cast(group->getParent()); + } + } +#endif + return this; +} + +#endif + +string XMLApplication::getNotificationURL(const char* resource, bool front, unsigned int index) const +{ + const vector& locs = front ? m_frontLogout : m_backLogout; + if (locs.empty()) + return m_base ? m_base->getNotificationURL(resource, front, index) : string(); + else if (index >= locs.size()) + return string(); + +#ifdef HAVE_STRCASECMP + if (!resource || (strncasecmp(resource,"http://",7) && strncasecmp(resource,"https://",8))) +#else + if (!resource || (strnicmp(resource,"http://",7) && strnicmp(resource,"https://",8))) +#endif + throw ConfigurationException("Request URL was not absolute."); + + const char* handler=locs[index].c_str(); + + // Should never happen... + if (!handler || (*handler!='/' && strncmp(handler,"http:",5) && strncmp(handler,"https:",6))) + throw ConfigurationException( + "Invalid Location property ($1) in Notify element for Application ($2)", + params(2, handler ? handler : "null", getId()) + ); + + // The "Location" property can be in one of three formats: + // + // 1) a full URI: http://host/foo/bar + // 2) a hostless URI: http:///foo/bar + // 3) a relative path: /foo/bar + // + // # Protocol Host Path + // 1 handler handler handler + // 2 handler resource handler + // 3 resource resource handler + + const char* path = NULL; + + // Decide whether to use the handler or the resource for the "protocol" + const char* prot; + if (*handler != '/') { + prot = handler; + } + else { + prot = resource; + path = handler; + } + + // break apart the "protocol" string into protocol, host, and "the rest" + const char* colon=strchr(prot,':'); + colon += 3; + const char* slash=strchr(colon,'/'); + if (!path) + path = slash; + + // Compute the actual protocol and store. + string notifyURL(prot, colon-prot); + + // create the "host" from either the colon/slash or from the target string + // If prot == handler then we're in either #1 or #2, else #3. + // If slash == colon then we're in #2. + if (prot != handler || slash == colon) { + colon = strchr(resource, ':'); + colon += 3; // Get past the :// + slash = strchr(colon, '/'); + } + string host(colon, (slash ? slash-colon : strlen(colon))); + + // Build the URL + notifyURL += host + path; + return notifyURL; +} + +const SessionInitiator* XMLApplication::getDefaultSessionInitiator() const +{ + if (m_sessionInitDefault) return m_sessionInitDefault; + return m_base ? m_base->getDefaultSessionInitiator() : NULL; +} + +const SessionInitiator* XMLApplication::getSessionInitiatorById(const char* id) const +{ + map::const_iterator i=m_sessionInitMap.find(id); + if (i!=m_sessionInitMap.end()) return i->second; + return m_base ? m_base->getSessionInitiatorById(id) : NULL; +} + +const Handler* XMLApplication::getDefaultAssertionConsumerService() const +{ + if (m_acsDefault) return m_acsDefault; + return m_base ? m_base->getDefaultAssertionConsumerService() : NULL; +} + +const Handler* XMLApplication::getAssertionConsumerServiceByIndex(unsigned short index) const +{ + map::const_iterator i=m_acsIndexMap.find(index); + if (i!=m_acsIndexMap.end()) return i->second; + return m_base ? m_base->getAssertionConsumerServiceByIndex(index) : NULL; +} + +const vector& XMLApplication::getAssertionConsumerServicesByBinding(const XMLCh* binding) const +{ +#ifdef HAVE_GOOD_STL + ACSBindingMap::const_iterator i=m_acsBindingMap.find(binding); +#else + auto_ptr_char temp(binding); + ACSBindingMap::const_iterator i=m_acsBindingMap.find(temp.get()); +#endif + if (i!=m_acsBindingMap.end()) + return i->second; + return m_base ? m_base->getAssertionConsumerServicesByBinding(binding) : g_noHandlers; +} + +const Handler* XMLApplication::getHandler(const char* path) const +{ + string wrap(path); + map::const_iterator i=m_handlerMap.find(wrap.substr(0,wrap.find('?'))); + if (i!=m_handlerMap.end()) + return i->second; + return m_base ? m_base->getHandler(path) : NULL; +} + +void XMLApplication::getHandlers(vector& handlers) const +{ + handlers.insert(handlers.end(), m_handlers.begin(), m_handlers.end()); + if (m_base) { + for (map::const_iterator h = m_base->m_handlerMap.begin(); h != m_base->m_handlerMap.end(); ++h) { + if (m_handlerMap.count(h->first) == 0) + handlers.push_back(h->second); + } + } +} + +short XMLConfigImpl::acceptNode(const DOMNode* node) const +{ + if (!XMLString::equals(node->getNamespaceURI(),shibspconstants::SHIB2SPCONFIG_NS)) + return FILTER_ACCEPT; + const XMLCh* name=node->getLocalName(); + if (XMLString::equals(name,ApplicationDefaults) || + XMLString::equals(name,_ArtifactMap) || + XMLString::equals(name,_Extensions) || + XMLString::equals(name,Listener) || + XMLString::equals(name,_RequestMapper) || + XMLString::equals(name,_ReplayCache) || + XMLString::equals(name,SecurityPolicies) || + XMLString::equals(name,_SessionCache) || + XMLString::equals(name,Site) || + XMLString::equals(name,_StorageService) || + XMLString::equals(name,TCPListener) || + XMLString::equals(name,TransportOption) || + XMLString::equals(name,UnixListener)) + return FILTER_REJECT; + + return FILTER_ACCEPT; +} + +void XMLConfigImpl::doExtensions(const DOMElement* e, const char* label, Category& log) +{ + const DOMElement* exts=XMLHelper::getFirstChildElement(e,_Extensions); + if (exts) { + exts=XMLHelper::getFirstChildElement(exts,Library); + while (exts) { + auto_ptr_char path(exts->getAttributeNS(NULL,_path)); + try { + if (path.get()) { + XMLToolingConfig::getConfig().load_library(path.get(),(void*)exts); + log.debug("loaded %s extension library (%s)", label, path.get()); + } + } + catch (exception& e) { + const XMLCh* fatal=exts->getAttributeNS(NULL,_fatal); + if (fatal && (*fatal==chLatin_t || *fatal==chDigit_1)) { + log.fatal("unable to load mandatory %s extension library %s: %s", label, path.get(), e.what()); + throw; + } + else { + log.crit("unable to load optional %s extension library %s: %s", label, path.get(), e.what()); + } + } + exts=XMLHelper::getNextSiblingElement(exts,Library); + } + } +} + +XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, const XMLConfig* outer, Category& log) + : m_requestMapper(NULL), m_outer(outer), m_document(NULL) +{ +#ifdef _DEBUG + xmltooling::NDC ndc("XMLConfigImpl"); +#endif + + try { + SPConfig& conf=SPConfig::getConfig(); +#ifndef SHIBSP_LITE + SAMLConfig& samlConf=SAMLConfig::getConfig(); +#endif + XMLToolingConfig& xmlConf=XMLToolingConfig::getConfig(); + const DOMElement* SHAR=XMLHelper::getFirstChildElement(e,OutOfProcess); + const DOMElement* SHIRE=XMLHelper::getFirstChildElement(e,InProcess); + + // Initialize log4cpp manually in order to redirect log messages as soon as possible. + if (conf.isEnabled(SPConfig::Logging)) { + const XMLCh* logconf=NULL; + if (conf.isEnabled(SPConfig::OutOfProcess)) + logconf=SHAR->getAttributeNS(NULL,logger); + else if (conf.isEnabled(SPConfig::InProcess)) + logconf=SHIRE->getAttributeNS(NULL,logger); + if (!logconf || !*logconf) + logconf=e->getAttributeNS(NULL,logger); + if (logconf && *logconf) { + auto_ptr_char logpath(logconf); + log.debug("loading new logging configuration from (%s), check log destination for status of configuration",logpath.get()); + XMLToolingConfig::getConfig().log_config(logpath.get()); + } + +#ifndef SHIBSP_LITE + if (first) + m_outer->m_tranLog = new TransactionLog(); +#endif + } + + // First load any property sets. + load(e,NULL,this); + + const DOMElement* child; + string plugtype; + + // Much of the processing can only occur on the first instantiation. + if (first) { + // Set clock skew. + pair skew=getUnsignedInt("clockSkew"); + if (skew.first) + xmlConf.clock_skew_secs=skew.second; + + // Extensions + doExtensions(e, "global", log); + if (conf.isEnabled(SPConfig::OutOfProcess)) + doExtensions(SHAR, "out of process", log); + + if (conf.isEnabled(SPConfig::InProcess)) + doExtensions(SHIRE, "in process", log); + + // Instantiate the ListenerService and SessionCache objects. + if (conf.isEnabled(SPConfig::Listener)) { + child=XMLHelper::getFirstChildElement(e,UnixListener); + if (child) + plugtype=UNIX_LISTENER_SERVICE; + else { + child=XMLHelper::getFirstChildElement(e,TCPListener); + if (child) + plugtype=TCP_LISTENER_SERVICE; + else { + child=XMLHelper::getFirstChildElement(e,Listener); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + if (type.get()) + plugtype=type.get(); + } + } + } + if (child) { + log.info("building ListenerService of type %s...", plugtype.c_str()); + m_outer->m_listener = conf.ListenerServiceManager.newPlugin(plugtype.c_str(), child); + } + else { + log.fatal("can't build ListenerService, missing conf:Listener element?"); + throw ConfigurationException("Can't build ListenerService, missing conf:Listener element?"); + } + } + +#ifndef SHIBSP_LITE + if (m_outer->m_listener && conf.isEnabled(SPConfig::OutOfProcess) && !conf.isEnabled(SPConfig::InProcess)) { + m_outer->m_listener->regListener("set::RelayState", m_outer->m_listener); + m_outer->m_listener->regListener("get::RelayState", m_outer->m_listener); + } +#endif + + if (conf.isEnabled(SPConfig::Caching)) { + if (conf.isEnabled(SPConfig::OutOfProcess)) { +#ifndef SHIBSP_LITE + // First build any StorageServices. + child=XMLHelper::getFirstChildElement(e,_StorageService); + while (child) { + auto_ptr_char id(child->getAttributeNS(NULL,_id)); + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + try { + log.info("building StorageService (%s) of type %s...", id.get(), type.get()); + m_outer->m_storage[id.get()] = xmlConf.StorageServiceManager.newPlugin(type.get(),child); + } + catch (exception& ex) { + log.crit("failed to instantiate StorageService (%s): %s", id.get(), ex.what()); + } + child=XMLHelper::getNextSiblingElement(child,_StorageService); + } + + // Replay cache. + StorageService* replaySS=NULL; + child=XMLHelper::getFirstChildElement(e,_ReplayCache); + if (child) { + auto_ptr_char ssid(child->getAttributeNS(NULL,_StorageService)); + if (ssid.get() && *ssid.get()) { + if (m_outer->m_storage.count(ssid.get())) + replaySS = m_outer->m_storage[ssid.get()]; + if (replaySS) + log.info("building ReplayCache on top of StorageService (%s)...", ssid.get()); + else + log.warn("unable to locate StorageService (%s) for ReplayCache, using dedicated in-memory instance", ssid.get()); + } + xmlConf.setReplayCache(new ReplayCache(replaySS)); + } + else { + log.warn("no ReplayCache built, missing conf:ReplayCache element?"); + } + + // ArtifactMap + child=XMLHelper::getFirstChildElement(e,_ArtifactMap); + if (child) { + auto_ptr_char ssid(child->getAttributeNS(NULL,_StorageService)); + if (ssid.get() && *ssid.get() && m_outer->m_storage.count(ssid.get())) { + log.info("building ArtifactMap on top of StorageService (%s)...", ssid.get()); + samlConf.setArtifactMap(new ArtifactMap(child, m_outer->m_storage[ssid.get()])); + } + } + if (samlConf.getArtifactMap()==NULL) { + log.info("building in-memory ArtifactMap..."); + samlConf.setArtifactMap(new ArtifactMap(child)); + } +#endif + } + child=XMLHelper::getFirstChildElement(e,_SessionCache); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building SessionCache of type %s...",type.get()); + m_outer->m_sessionCache=conf.SessionCacheManager.newPlugin(type.get(), child); + } + else { + log.fatal("can't build SessionCache, missing conf:SessionCache element?"); + throw ConfigurationException("Can't build SessionCache, missing conf:SessionCache element?"); + } + } + } // end of first-time-only stuff + + // Back to the fully dynamic stuff...next up is the RequestMapper. + if (conf.isEnabled(SPConfig::RequestMapping)) { + child=XMLHelper::getFirstChildElement(e,_RequestMapper); + if (child) { + auto_ptr_char type(child->getAttributeNS(NULL,_type)); + log.info("building RequestMapper of type %s...",type.get()); + m_requestMapper=conf.RequestMapperManager.newPlugin(type.get(),child); + } + else { + log.fatal("can't build RequestMapper, missing conf:RequestMapper element?"); + throw ConfigurationException("Can't build RequestMapper, missing conf:RequestMapper element?"); + } + } + +#ifndef SHIBSP_LITE + // Load security policies. + child = XMLHelper::getLastChildElement(e,SecurityPolicies); + if (child) { + PolicyNodeFilter filter; + child = XMLHelper::getFirstChildElement(child,Policy); + while (child) { + auto_ptr_char id(child->getAttributeNS(NULL,_id)); + pair< PropertySet*,vector >& rules = m_policyMap[id.get()]; + rules.first = NULL; + auto_ptr settings(new DOMPropertySet()); + settings->load(child, NULL, &filter); + rules.first = settings.release(); + + // Process Rule elements. + const DOMElement* rule = XMLHelper::getFirstChildElement(child,Rule); + while (rule) { + auto_ptr_char type(rule->getAttributeNS(NULL,_type)); + try { + rules.second.push_back(samlConf.SecurityPolicyRuleManager.newPlugin(type.get(),rule)); + } + catch (exception& ex) { + log.crit("error instantiating policy rule (%s) in policy (%s): %s", type.get(), id.get(), ex.what()); + } + rule = XMLHelper::getNextSiblingElement(rule,Rule); + } + + child = XMLHelper::getNextSiblingElement(child,Policy); + } + } + + // Process TransportOption elements. + child = XMLHelper::getLastChildElement(e,TransportOption); + while (child) { + if (child->hasChildNodes()) { + auto_ptr_char provider(child->getAttributeNS(NULL,_provider)); + auto_ptr_char option(child->getAttributeNS(NULL,_option)); + auto_ptr_char value(child->getFirstChild()->getNodeValue()); + if (provider.get() && *provider.get() && option.get() && *option.get() && value.get() && *value.get()) { + m_transportOptions.push_back(make_pair(string(provider.get()), make_pair(string(option.get()), string(value.get())))); + } + } + child = XMLHelper::getPreviousSiblingElement(child,TransportOption); + } +#endif + + // Load the default application. This actually has a fixed ID of "default". ;-) + child=XMLHelper::getLastChildElement(e,ApplicationDefaults); + if (!child) { + log.fatal("can't build default Application object, missing conf:ApplicationDefaults element?"); + throw ConfigurationException("can't build default Application object, missing conf:ApplicationDefaults element?"); + } + XMLApplication* defapp=new XMLApplication(m_outer,child); + m_appmap[defapp->getId()]=defapp; + + // Load any overrides. + child = XMLHelper::getFirstChildElement(child,ApplicationOverride); + while (child) { + auto_ptr iapp(new XMLApplication(m_outer,child,defapp)); + if (m_appmap.count(iapp->getId())) + log.crit("found conf:ApplicationOverride element with duplicate id attribute (%s), skipping it", iapp->getId()); + else + m_appmap[iapp->getId()]=iapp.release(); + + child = XMLHelper::getNextSiblingElement(child,ApplicationOverride); + } + } + catch (exception&) { + cleanup(); + throw; + } +} + +XMLConfigImpl::~XMLConfigImpl() +{ + cleanup(); +} + +void XMLConfigImpl::cleanup() +{ + for_each(m_appmap.begin(),m_appmap.end(),cleanup_pair()); + m_appmap.clear(); +#ifndef SHIBSP_LITE + for (map< string,pair > >::iterator i=m_policyMap.begin(); i!=m_policyMap.end(); ++i) { + delete i->second.first; + for_each(i->second.second.begin(), i->second.second.end(), xmltooling::cleanup()); + } + m_policyMap.clear(); +#endif + delete m_requestMapper; + m_requestMapper = NULL; + if (m_document) + m_document->release(); + m_document = NULL; +} + +#ifndef SHIBSP_LITE +void XMLConfig::receive(DDF& in, ostream& out) +{ + if (!strcmp(in.name(), "get::RelayState")) { + const char* id = in["id"].string(); + const char* key = in["key"].string(); + if (!id || !key) + throw ListenerException("Required parameters missing for RelayState recovery."); + + string relayState; + StorageService* storage = getStorageService(id); + if (storage) { + if (storage->readString("RelayState",key,&relayState)>0) { + if (in["clear"].integer()) + storage->deleteString("RelayState",key); + } + } + else { + Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error( + "Storage-backed RelayState with invalid StorageService ID (%s)", id + ); + } + + // Repack for return to caller. + DDF ret=DDF(NULL).string(relayState.c_str()); + DDFJanitor jret(ret); + out << ret; + } + else if (!strcmp(in.name(), "set::RelayState")) { + const char* id = in["id"].string(); + const char* value = in["value"].string(); + if (!id || !value) + throw ListenerException("Required parameters missing for RelayState creation."); + + string rsKey; + StorageService* storage = getStorageService(id); + if (storage) { + SAMLConfig::getConfig().generateRandomBytes(rsKey,20); + rsKey = SAMLArtifact::toHex(rsKey); + storage->createString("RelayState", rsKey.c_str(), value, time(NULL) + 600); + } + else { + Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error( + "Storage-backed RelayState with invalid StorageService ID (%s)", id + ); + } + + // Repack for return to caller. + DDF ret=DDF(NULL).string(rsKey.c_str()); + DDFJanitor jret(ret); + out << ret; + } +} +#endif + +pair XMLConfig::load() +{ + // Load from source using base class. + pair raw = ReloadableXMLFile::load(); + + // If we own it, wrap it. + XercesJanitor docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL); + + XMLConfigImpl* impl = new XMLConfigImpl(raw.second,(m_impl==NULL),this,m_log); + + // If we held the document, transfer it to the impl. If we didn't, it's a no-op. + impl->setDocument(docjanitor.release()); + + delete m_impl; + m_impl = impl; + + return make_pair(false,(DOMElement*)NULL); +} diff --git a/shibsp/internal.h b/shibsp/internal.h new file mode 100644 index 0000000..1b5e9e5 --- /dev/null +++ b/shibsp/internal.h @@ -0,0 +1,51 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * internal.h - internally visible classes + */ + +#ifndef __shibsp_internal_h__ +#define __shibsp_internal_h__ + +#ifndef FD_SETSIZE +# define FD_SETSIZE 1024 +#endif + +#ifdef WIN32 +# define _CRT_SECURE_NO_DEPRECATE 1 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif + +// Export public APIs +#define SHIBSP_EXPORTS + +// eventually we might be able to support autoconf via cygwin... +#if defined (_MSC_VER) || defined(__BORLANDC__) +# include "config_win32.h" +#else +# include "config.h" +#endif + +#include "base.h" +#include "SPConfig.h" + +#include + +using namespace xmltooling::logging; +using namespace xercesc; + +#endif /* __shibsp_internal_h__ */ diff --git a/shibsp/lite/CommonDomainCookie.cpp b/shibsp/lite/CommonDomainCookie.cpp new file mode 100644 index 0000000..fd3bfba --- /dev/null +++ b/shibsp/lite/CommonDomainCookie.cpp @@ -0,0 +1,100 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * CommonDomainCookie.cpp + * + * Helper class for maintaining discovery cookie. + */ + +#include "internal.h" +#include "lite/CommonDomainCookie.h" + +#include +#include +#include + +using namespace opensaml; +using namespace xmltooling; +using namespace std; + +const char CommonDomainCookie::CDCName[] = "_saml_idp"; + +CommonDomainCookie::CommonDomainCookie(const char* cookie) +{ + if (!cookie) + return; + + // Copy it so we can URL-decode it. + char* b64=strdup(cookie); + XMLToolingConfig::getConfig().getURLEncoder()->decode(b64); + + // Chop it up and save off elements. + vector templist; + char* ptr=b64; + while (*ptr) { + while (*ptr && isspace(*ptr)) ptr++; + char* end=ptr; + while (*end && !isspace(*end)) end++; + templist.push_back(string(ptr,end-ptr)); + ptr=end; + } + free(b64); + + // Now Base64 decode the list. + unsigned int len; + for (vector::iterator i=templist.begin(); i!=templist.end(); ++i) { + XMLByte* decoded=Base64::decode(reinterpret_cast(i->c_str()),&len); + if (decoded && *decoded) { + m_list.push_back(reinterpret_cast(decoded)); + XMLString::release(&decoded); + } + } +} + +const char* CommonDomainCookie::set(const char* entityID) +{ + // First scan the list for this IdP. + for (vector::iterator i=m_list.begin(); i!=m_list.end(); i++) { + if (*i == entityID) { + m_list.erase(i); + break; + } + } + + // Append it to the end. + m_list.push_back(entityID); + + // Now rebuild the delimited list. + unsigned int len; + string delimited; + for (vector::const_iterator j=m_list.begin(); j!=m_list.end(); j++) { + if (!delimited.empty()) delimited += ' '; + + XMLByte* b64=Base64::encode(reinterpret_cast(j->c_str()),j->length(),&len); + XMLByte *pos, *pos2; + for (pos=b64, pos2=b64; *pos2; pos2++) + if (isgraph(*pos2)) + *pos++=*pos2; + *pos=0; + + delimited += reinterpret_cast(b64); + XMLString::release(&b64); + } + + m_encoded=XMLToolingConfig::getConfig().getURLEncoder()->encode(delimited.c_str()); + return m_encoded.c_str(); +} diff --git a/shibsp/lite/CommonDomainCookie.h b/shibsp/lite/CommonDomainCookie.h new file mode 100644 index 0000000..a15f88c --- /dev/null +++ b/shibsp/lite/CommonDomainCookie.h @@ -0,0 +1,82 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/lite/CommonDomainCookie.h + * + * Helper class for maintaining discovery cookie. + */ + +#ifndef __shibsp_cdc_h__ +#define __shibsp_cdc_h__ + +#include + +#include +#include + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 4251 ) +#endif + +namespace opensaml { + /** + * Helper class for maintaining discovery cookie. + */ + class SHIBSP_API CommonDomainCookie { + MAKE_NONCOPYABLE(CommonDomainCookie); + public: + /** + * Parses a cookie for reading or writing. + * + * @param cookie the raw cookie value + */ + CommonDomainCookie(const char* cookie); + + ~CommonDomainCookie() {} + + /** + * Returns list of IdPs stored in cookie. + * + * @return reference to vector of entityIDs + */ + const std::vector& get() const { + return m_list; + } + + /** + * Adds/moves an IdP to the front of the list. + * + * @param entityID name of IdP to add + * @return new value of cookie + */ + const char* set(const char* entityID); + + /** Name of cookie ("_saml_idp") */ + static const char CDCName[]; + + private: + std::string m_encoded; + std::vector m_list; + }; +}; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +#endif /* __saml_cdc_h__ */ diff --git a/shibsp/lite/SAMLConstants.cpp b/shibsp/lite/SAMLConstants.cpp new file mode 100644 index 0000000..5c2be15 --- /dev/null +++ b/shibsp/lite/SAMLConstants.cpp @@ -0,0 +1,207 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SAMLConstants.cpp + * + * SAML XML namespace constants + */ + + +#include "internal.h" +#include "lite/SAMLConstants.h" +#include + +using namespace xercesc; +using namespace samlconstants; + +const XMLCh samlconstants::PAOS_NS[] = // urn:liberty:paos:2003-08 +{ chLatin_u, chLatin_r, chLatin_n, chColon, + chLatin_l, chLatin_i, chLatin_b, chLatin_e, chLatin_r, chLatin_t, chLatin_y, chColon, + chLatin_p, chLatin_a, chLatin_o, chLatin_s, chColon, + chDigit_2, chDigit_0, chDigit_0, chDigit_3, chDash, chDigit_0, chDigit_8, chNull +}; + +const XMLCh samlconstants::PAOS_PREFIX[] = UNICODE_LITERAL_4(p,a,o,s); + +const XMLCh samlconstants::SAML1_NS[] = // urn:oasis:names:tc:SAML:1.0:assertion +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_s, chLatin_s, chLatin_e, chLatin_r, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull +}; + +const XMLCh samlconstants::SAML1P_NS[] = // urn:oasis:names:tc:SAML:1.0:protocol +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull +}; + +const XMLCh samlconstants::SAML1_PREFIX[] = UNICODE_LITERAL_4(s,a,m,l); + +const XMLCh samlconstants::SAML1P_PREFIX[] = UNICODE_LITERAL_5(s,a,m,l,p); + +const XMLCh samlconstants::SAML20_VERSION[] = // 2.0 +{ chDigit_2, chPeriod, chDigit_0, chNull +}; + +const XMLCh samlconstants::SAML20_NS[] = // urn:oasis:names:tc:SAML:2.0:assertion +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_s, chLatin_s, chLatin_e, chLatin_r, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull +}; + +const XMLCh samlconstants::SAML20P_NS[] = // urn:oasis:names:tc:SAML:2.0:protocol +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull +}; + +const XMLCh samlconstants::SAML20MD_NS[] = // urn:oasis:names:tc:SAML:2.0:metadata +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chNull +}; + +const XMLCh samlconstants::SAML20AC_NS[] = // urn:oasis:names:tc:SAML:2.0:ac +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chNull +}; + +const XMLCh samlconstants::SAML20_PREFIX[] = UNICODE_LITERAL_4(s,a,m,l); + +const XMLCh samlconstants::SAML20P_PREFIX[] = UNICODE_LITERAL_5(s,a,m,l,p); + +const XMLCh samlconstants::SAML20MD_PREFIX[] = UNICODE_LITERAL_2(m,d); + +const XMLCh samlconstants::SAML20AC_PREFIX[] = UNICODE_LITERAL_2(a,c); + +const XMLCh samlconstants::SAML20ECP_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_S, chLatin_S, chLatin_O, chColon, chLatin_e, chLatin_c, chLatin_p, chNull +}; + +const XMLCh samlconstants::SAML20ECP_PREFIX[] = UNICODE_LITERAL_3(e,c,p); + +const XMLCh samlconstants::SAML20DCE_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:attribute:DCE +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chColon, + chLatin_D, chLatin_C, chLatin_E, chNull +}; + +const XMLCh samlconstants::SAML20DCE_PREFIX[] = UNICODE_LITERAL_3(D,C,E); + +const XMLCh samlconstants::SAML20X500_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500 +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chColon, + chLatin_X, chDigit_5, chDigit_0, chDigit_0, chNull +}; + +const XMLCh samlconstants::SAML20X500_PREFIX[] = { chLatin_x, chDigit_5, chDigit_0, chDigit_0 }; + +const XMLCh samlconstants::SAML20XACML_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:attribute:XACML +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chColon, + chLatin_X, chLatin_A, chLatin_C, chLatin_M, chLatin_L, chNull +}; + +const XMLCh samlconstants::SAML20XACML_PREFIX[] = UNICODE_LITERAL_9(x,a,c,m,l,p,r,o,f); + +const XMLCh samlconstants::SAML1MD_NS[] = // urn:oasis:names:tc:SAML:profiles:v1metadata +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_v, chDigit_1, chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chNull +}; + +const XMLCh samlconstants::SAML1MD_PREFIX[] = +{ chLatin_s, chLatin_a, chLatin_m, chLatin_l, chDigit_1, chLatin_m, chLatin_d, chNull }; + +const XMLCh samlconstants::SAML10_PROTOCOL_ENUM[] = // urn:oasis:names:tc:SAML:1.0:protocol +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull +}; + +const XMLCh samlconstants::SAML11_PROTOCOL_ENUM[] = // urn:oasis:names:tc:SAML:1.1:protocol +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull +}; + +const XMLCh samlconstants::SAML20MD_QUERY_EXT_NS[] = // urn:oasis:names:tc:SAML:metadata:ext:query +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, + chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chColon, + chLatin_e, chLatin_x, chLatin_t, chColon, chLatin_q, chLatin_u, chLatin_e, chLatin_r, chLatin_y, chNull +}; + +const XMLCh samlconstants::SAML20MD_QUERY_EXT_PREFIX[] = UNICODE_LITERAL_5(q,u,e,r,y); + +const XMLCh samlconstants::SAML20P_THIRDPARTY_EXT_NS[] = // urn:oasis:names:tc:SAML:protocol:ext:third-party +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chColon, + chLatin_e, chLatin_x, chLatin_t, chColon, + chLatin_t, chLatin_h, chLatin_i, chLatin_r, chLatin_d, chDash, chLatin_p, chLatin_a, chLatin_r, chLatin_t, chLatin_y, chNull +}; + +const XMLCh samlconstants::SAML20P_THIRDPARTY_EXT_PREFIX[] = UNICODE_LITERAL_6(t,h,r,p,t,y); + +const char samlconstants::SAML1_BINDING_SOAP[] = "urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"; + +const char samlconstants::SAML1_PROFILE_BROWSER_ARTIFACT[] = "urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"; + +const char samlconstants::SAML1_PROFILE_BROWSER_POST[] = "urn:oasis:names:tc:SAML:1.0:profiles:browser-post"; + +const char samlconstants::SAML20_BINDING_SOAP[] = "urn:oasis:names:tc:SAML:2.0:bindings:SOAP"; + +const char samlconstants::SAML20_BINDING_PAOS[] = "urn:oasis:names:tc:SAML:2.0:bindings:PAOS"; + +const char samlconstants::SAML20_BINDING_URI[] = "urn:oasis:names:tc:SAML:2.0:bindings:URI"; + +const char samlconstants::SAML20_BINDING_HTTP_ARTIFACT[] = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"; + +const char samlconstants::SAML20_BINDING_HTTP_POST[] = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"; + +const char samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN[] = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"; + +const char samlconstants::SAML20_BINDING_HTTP_REDIRECT[] = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"; + +const char samlconstants::SAML20_BINDING_URL_ENCODING_DEFLATE[] = "urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE"; diff --git a/shibsp/lite/SAMLConstants.h b/shibsp/lite/SAMLConstants.h new file mode 100644 index 0000000..74e0004 --- /dev/null +++ b/shibsp/lite/SAMLConstants.h @@ -0,0 +1,160 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/lite/SAMLConstants.h + * + * SAML XML namespace constants + */ + +#ifndef __shibsp_xmlconstants_h__ +#define __shibsp_xmlconstants_h__ + +#include + +/** + * SAML related constants. + */ +namespace samlconstants { + + /** Liberty PAOS XML Namespace ("urn:liberty:paos:2003-08") */ + extern SHIBSP_API const XMLCh PAOS_NS[]; + + /** Liberty PAOS QName prefix ("paos") */ + extern SHIBSP_API const XMLCh PAOS_PREFIX[]; + + /** SAML 1.X Assertion XML namespace ("urn:oasis:names:tc:SAML:1.0:assertion") */ + extern SHIBSP_API const XMLCh SAML1_NS[]; + + /** SAML 1.X Protocol XML namespace ("urn:oasis:names:tc:SAML:1.0:protocol") */ + extern SHIBSP_API const XMLCh SAML1P_NS[]; + + /** SAML 1.X Assertion QName prefix ("saml") */ + extern SHIBSP_API const XMLCh SAML1_PREFIX[]; + + /** SAML 1.X Protocol QName prefix ("samlp") */ + extern SHIBSP_API const XMLCh SAML1P_PREFIX[]; + + /** SAML 2.0 Version ("2.0") */ + extern SHIBSP_API const XMLCh SAML20_VERSION[]; + + /** SAML 2.0 Assertion XML namespace ("urn:oasis:names:tc:SAML:2.0:assertion") */ + extern SHIBSP_API const XMLCh SAML20_NS[]; + + /** SAML 2.0 Protocol XML namespace ("urn:oasis:names:tc:SAML:2.0:protocol") */ + extern SHIBSP_API const XMLCh SAML20P_NS[]; + + /** SAML 2.0 Metadata XML namespace ("urn:oasis:names:tc:SAML:2.0:metadata") */ + extern SHIBSP_API const XMLCh SAML20MD_NS[]; + + /** SAML 2.0 AuthnContext XML namespace ("urn:oasis:names:tc:SAML:2.0:ac") */ + extern SHIBSP_API const XMLCh SAML20AC_NS[]; + + /** SAML 2.0 Assertion QName prefix ("saml") */ + extern SHIBSP_API const XMLCh SAML20_PREFIX[]; + + /** SAML 2.0 Protocol QName prefix ("samlp") */ + extern SHIBSP_API const XMLCh SAML20P_PREFIX[]; + + /** SAML 2.0 Metadata QName prefix ("md") */ + extern SHIBSP_API const XMLCh SAML20MD_PREFIX[]; + + /** SAML 2.0 AuthnContext QName prefix ("ac") */ + extern SHIBSP_API const XMLCh SAML20AC_PREFIX[]; + + /** SAML 2.0 Enhanced Client/Proxy SSO Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp") */ + extern SHIBSP_API const XMLCh SAML20ECP_NS[]; + + /** SAML 2.0 Enhanced Client/Proxy SSO Profile QName prefix ("ecp") */ + extern SHIBSP_API const XMLCh SAML20ECP_PREFIX[]; + + /** SAML 2.0 DCE PAC Attribute Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:attribute:DCE") */ + extern SHIBSP_API const XMLCh SAML20DCE_NS[]; + + /** SAML 2.0 DCE PAC Attribute Profile QName prefix ("DCE") */ + extern SHIBSP_API const XMLCh SAML20DCE_PREFIX[]; + + /** SAML 2.0 X.500 Attribute Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500") */ + extern SHIBSP_API const XMLCh SAML20X500_NS[]; + + /** SAML 2.0 X.500 Attribute Profile QName prefix ("x500") */ + extern SHIBSP_API const XMLCh SAML20X500_PREFIX[]; + + /** SAML 2.0 XACML Attribute Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:attribute:XACML") */ + extern SHIBSP_API const XMLCh SAML20XACML_NS[]; + + /** SAML 2.0 XACML Attribute Profile QName prefix ("xacmlprof") */ + extern SHIBSP_API const XMLCh SAML20XACML_PREFIX[]; + + /** SAML 1.x Metadata Profile XML Namespace ("urn:oasis:names:tc:SAML:profiles:v1metadata") */ + extern SHIBSP_API const XMLCh SAML1MD_NS[]; + + /** SAML 1.x Metadata Profile QName prefix ("saml1md") */ + extern SHIBSP_API const XMLCh SAML1MD_PREFIX[]; + + /** SAML 1.0 Protocol Enumeration constant ("urn:oasis:names:tc:SAML:1.0:protocol") */ + extern SHIBSP_API const XMLCh SAML10_PROTOCOL_ENUM[]; + + /** SAML 1.1 Protocol Enumeration constant ("urn:oasis:names:tc:SAML:1.1:protocol") */ + extern SHIBSP_API const XMLCh SAML11_PROTOCOL_ENUM[]; + + /** SAML Query Requester Metadata Extension XML Namespace ("urn:oasis:names:tc:SAML:metadata:ext:query") */ + extern SHIBSP_API const XMLCh SAML20MD_QUERY_EXT_NS[]; + + /** SAML Query Requester Metadata Extension QName prefix ("query") */ + extern SHIBSP_API const XMLCh SAML20MD_QUERY_EXT_PREFIX[]; + + /** SAML Third-Party Request Protocol Extension XML Namespace ("urn:oasis:names:tc:SAML:protocol:ext:third-party") */ + extern SHIBSP_API const XMLCh SAML20P_THIRDPARTY_EXT_NS[]; + + /** SAML Third-Party Request Protocol Extension QName prefix ("query") */ + extern SHIBSP_API const XMLCh SAML20P_THIRDPARTY_EXT_PREFIX[]; + + /** SAML 1.x SOAP binding ("urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding") */ + extern SHIBSP_API const char SAML1_BINDING_SOAP[]; + + /** SAML 1.x Browser Artifact profile ("urn:oasis:names:tc:SAML:1.0:profiles:artifact-01") */ + extern SHIBSP_API const char SAML1_PROFILE_BROWSER_ARTIFACT[]; + + /** SAML 1.x Browser POST profile ("urn:oasis:names:tc:SAML:1.0:profiles:browser-post") */ + extern SHIBSP_API const char SAML1_PROFILE_BROWSER_POST[]; + + /** SAML 2.0 SOAP binding ("urn:oasis:names:tc:SAML:2.0:bindings:SOAP") */ + extern SHIBSP_API const char SAML20_BINDING_SOAP[]; + + /** SAML 2.0 SOAP binding ("urn:oasis:names:tc:SAML:2.0:bindings:PAOS") */ + extern SHIBSP_API const char SAML20_BINDING_PAOS[]; + + /** SAML 2.0 URI binding ("urn:oasis:names:tc:SAML:2.0:bindings:URI") */ + extern SHIBSP_API const char SAML20_BINDING_URI[]; + + /** SAML 2.0 HTTP-Artifact binding ("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact") */ + extern SHIBSP_API const char SAML20_BINDING_HTTP_ARTIFACT[]; + + /** SAML 2.0 HTTP-POST binding ("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST") */ + extern SHIBSP_API const char SAML20_BINDING_HTTP_POST[]; + + /** SAML 2.0 HTTP-POST-SimpleSign binding ("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign") */ + extern SHIBSP_API const char SAML20_BINDING_HTTP_POST_SIMPLESIGN[]; + + /** SAML 2.0 HTTP-Redirect binding ("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect") */ + extern SHIBSP_API const char SAML20_BINDING_HTTP_REDIRECT[]; + + /** SAML 2.0 HTTP-Redirect DEFLATE URL encoding ("urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE") */ + extern SHIBSP_API const char SAML20_BINDING_URL_ENCODING_DEFLATE[]; +}; + +#endif /* __shibsp_xmlconstants_h__ */ diff --git a/shibsp/metadata/MetadataExt.h b/shibsp/metadata/MetadataExt.h new file mode 100644 index 0000000..d0badc0 --- /dev/null +++ b/shibsp/metadata/MetadataExt.h @@ -0,0 +1,55 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/metadata/MetadataExt.h + * + * XMLObjects representing Shibboleth metadata extensions + */ + +#ifndef __shibsp_metaext_h__ +#define __shibsp_metaext_h__ + +#include +#include +#include +#include + +#define DECL_SHIBOBJECTBUILDER(cname) \ + DECL_XMLOBJECTBUILDER(SHIBSP_API,cname,shibspconstants::SHIBMD_NS,shibspconstants::SHIBMD_PREFIX) + +namespace shibsp { + + BEGIN_XMLOBJECT(SHIBSP_API,Scope,xmltooling::XMLObject,Scope element); + DECL_BOOLEAN_ATTRIB(Regexp,REGEXP,false); + DECL_SIMPLE_CONTENT(Value); + END_XMLOBJECT; + + BEGIN_XMLOBJECT(SHIBSP_API,KeyAuthority,xmltooling::AttributeExtensibleXMLObject,KeyAuthority element); + DECL_INTEGER_ATTRIB(VerifyDepth,VERIFYDEPTH); + DECL_TYPED_FOREIGN_CHILDREN(KeyInfo,xmlsignature); + END_XMLOBJECT; + + DECL_SHIBOBJECTBUILDER(Scope); + DECL_SHIBOBJECTBUILDER(KeyAuthority); + + /** + * Registers builders and validators for Shibboleth metadata extension classes into the runtime. + */ + void SHIBSP_API registerMetadataExtClasses(); +}; + +#endif /* __shibsp_metaext_h__ */ diff --git a/shibsp/metadata/MetadataExtImpl.cpp b/shibsp/metadata/MetadataExtImpl.cpp new file mode 100644 index 0000000..6188b46 --- /dev/null +++ b/shibsp/metadata/MetadataExtImpl.cpp @@ -0,0 +1,162 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * MetadataExtImpl.cpp + * + * Implementation classes for Shibboleth metadata extensions schema + */ + +#include "internal.h" +#include "exceptions.h" +#include "metadata/MetadataExt.h" + +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace xmlsignature; +using namespace xmltooling; +using namespace std; + +using xmlconstants::XMLSIG_NS; +using xmlconstants::XML_BOOL_NULL; +using shibspconstants::SHIBMD_NS; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 4251 ) +#endif + +namespace shibsp { + + class SHIBSP_DLLLOCAL ScopeImpl : public virtual Scope, + public AbstractSimpleElement, + public AbstractDOMCachingXMLObject, + public AbstractXMLObjectMarshaller, + public AbstractXMLObjectUnmarshaller + { + void init() { + m_Regexp=XML_BOOL_NULL; + } + + public: + + ScopeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + init(); + } + + ScopeImpl(const ScopeImpl& src) + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) { + init(); + Regexp(src.m_Regexp); + } + + IMPL_XMLOBJECT_CLONE(Scope); + IMPL_BOOLEAN_ATTRIB(Regexp); + + protected: + void marshallAttributes(DOMElement* domElement) const { + MARSHALL_BOOLEAN_ATTRIB(Regexp,REGEXP,NULL); + } + + void processAttribute(const DOMAttr* attribute) { + PROC_BOOLEAN_ATTRIB(Regexp,REGEXP,NULL); + AbstractXMLObjectUnmarshaller::processAttribute(attribute); + } + }; + + class SHIBSP_DLLLOCAL KeyAuthorityImpl : public virtual KeyAuthority, + public AbstractComplexElement, + public AbstractAttributeExtensibleXMLObject, + public AbstractDOMCachingXMLObject, + public AbstractXMLObjectMarshaller, + public AbstractXMLObjectUnmarshaller + { + void init() { + m_VerifyDepth=NULL; + } + public: + virtual ~KeyAuthorityImpl() { + XMLString::release(&m_VerifyDepth); + } + + KeyAuthorityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + init(); + } + + KeyAuthorityImpl(const KeyAuthorityImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), + AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { + init(); + setVerifyDepth(src.m_VerifyDepth); + VectorOf(KeyInfo) v=getKeyInfos(); + for (vector::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i) + v.push_back((*i)->cloneKeyInfo()); + } + + IMPL_XMLOBJECT_CLONE(KeyAuthority); + IMPL_INTEGER_ATTRIB(VerifyDepth); + IMPL_TYPED_CHILDREN(KeyInfo,m_children.end()); + + public: + void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) { + if (!qualifiedName.hasNamespaceURI()) { + if (XMLString::equals(qualifiedName.getLocalPart(),VERIFYDEPTH_ATTRIB_NAME)) { + setVerifyDepth(value); + return; + } + } + AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID); + } + + protected: + void marshallAttributes(DOMElement* domElement) const { + MARSHALL_INTEGER_ATTRIB(VerifyDepth,VERIFYDEPTH,NULL); + marshallExtensionAttributes(domElement); + } + + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { + PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false); + AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); + } + + void processAttribute(const DOMAttr* attribute) { + unmarshallExtensionAttribute(attribute); + } + }; + +}; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +// Builder Implementations + +IMPL_XMLOBJECTBUILDER(Scope); +IMPL_XMLOBJECTBUILDER(KeyAuthority); + +const XMLCh Scope::LOCAL_NAME[] = UNICODE_LITERAL_5(S,c,o,p,e); +const XMLCh Scope::REGEXP_ATTRIB_NAME[] = UNICODE_LITERAL_6(r,e,g,e,x,p); +const XMLCh KeyAuthority::LOCAL_NAME[] = UNICODE_LITERAL_12(K,e,y,A,u,t,h,o,r,i,t,y); +const XMLCh KeyAuthority::VERIFYDEPTH_ATTRIB_NAME[] = UNICODE_LITERAL_11(V,e,r,i,f,y,D,e,p,t,h); diff --git a/shibsp/metadata/MetadataExtSchemaValidators.cpp b/shibsp/metadata/MetadataExtSchemaValidators.cpp new file mode 100644 index 0000000..e4a4e56 --- /dev/null +++ b/shibsp/metadata/MetadataExtSchemaValidators.cpp @@ -0,0 +1,52 @@ +/* +* Copyright 2001-2007 Internet2 + * +* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * MetadataExtSchemaValidators.cpp + * + * Schema-based validators for Shibboleth metadata extension classes + */ + +#include "internal.h" +#include "exceptions.h" +#include "metadata/MetadataExt.h" + +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +using shibspconstants::SHIBMD_NS; + +namespace shibsp { + XMLOBJECTVALIDATOR_SIMPLE(SHIBSP_DLLLOCAL,Scope); + + BEGIN_XMLOBJECTVALIDATOR(SHIBSP_DLLLOCAL,KeyAuthority); + XMLOBJECTVALIDATOR_NONEMPTY(KeyAuthority,KeyInfo); + END_XMLOBJECTVALIDATOR; +}; + +#define REGISTER_ELEMENT(cname) \ + q=QName(SHIBMD_NS,cname::LOCAL_NAME); \ + XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \ + SchemaValidators.registerValidator(q,new cname##SchemaValidator()) + +void shibsp::registerMetadataExtClasses() { + QName q; + REGISTER_ELEMENT(Scope); + REGISTER_ELEMENT(KeyAuthority); +} diff --git a/shibsp/paths.h b/shibsp/paths.h new file mode 100644 index 0000000..4aa5d5e --- /dev/null +++ b/shibsp/paths.h @@ -0,0 +1,46 @@ +/* + * Copyright 2001-2005 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/paths.h + * + * Default configuration paths. + */ + +#ifndef __shibsp_paths_h__ +#define __shibsp_paths_h__ + +/** + * Default schema catalogs. + */ +#define SHIBSP_SCHEMAS "/usr/share/xml/xmltooling/catalog.xml:/usr/share/xml/opensaml/saml20-catalog.xml:/usr/share/xml/opensaml/saml11-catalog.xml:/usr/local/share/xml/shibboleth/catalog.xml" + +/** + * Default name of SP configuration file. + */ +#define SHIBSP_CONFIG "shibboleth2.xml" + +/** + * Default name of SP console tool logging file. + */ +#define SHIBSP_LOGGING "console.logger" + +/** + * Default prefix for installation (used to resolve relative paths). + */ +#define SHIBSP_PREFIX "/usr/local" + +#endif /* __shibsp_paths_h__ */ diff --git a/shibsp/paths.h.in b/shibsp/paths.h.in new file mode 100644 index 0000000..9f5e2b1 --- /dev/null +++ b/shibsp/paths.h.in @@ -0,0 +1,46 @@ +/* + * Copyright 2001-2005 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/paths.h + * + * Default configuration paths. + */ + +#ifndef __shibsp_paths_h__ +#define __shibsp_paths_h__ + +/** + * Default schema catalogs. + */ +#define SHIBSP_SCHEMAS "@-XMLTOOLINGXMLDIR-@/catalog.xml:@-OPENSAMLXMLDIR-@/saml20-catalog.xml:@-OPENSAMLXMLDIR-@/saml11-catalog.xml:@-PKGXMLDIR-@/catalog.xml" + +/** + * Default name of SP configuration file. + */ +#define SHIBSP_CONFIG "shibboleth2.xml" + +/** + * Default name of SP console tool logging file. + */ +#define SHIBSP_LOGGING "console.logger" + +/** + * Default prefix for installation (used to resolve relative paths). + */ +#define SHIBSP_PREFIX "@-PREFIX-@" + +#endif /* __shibsp_paths_h__ */ diff --git a/shibsp/remoting/ListenerService.h b/shibsp/remoting/ListenerService.h new file mode 100644 index 0000000..3e8c6b3 --- /dev/null +++ b/shibsp/remoting/ListenerService.h @@ -0,0 +1,147 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/remoting/ListenerService.h + * + * Interprocess remoting engine. + */ + +#ifndef __shibsp_listener_h__ +#define __shibsp_listener_h__ + +#include +#include + +namespace shibsp { + + /** + * Interface to a remoted service + * + * Classes that support remoted messages delivered by the Listener runtime + * support this interface and register themselves with the runtime to receive + * particular messages. + */ + class SHIBSP_API Remoted + { + MAKE_NONCOPYABLE(Remoted); + protected: + Remoted() {} + public: + virtual ~Remoted() {} + + /** + * Remoted classes implement this method to process incoming messages. + * + * @param in incoming DDF message + * @param out stream to write outgoing DDF message to + */ + virtual void receive(DDF& in, std::ostream& out)=0; + }; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 4251 ) +#endif + + /** + * Interface to a remoting engine. + * + * A ListenerService supports the remoting of DDF objects, which are dynamic data trees + * that other class implementations can use to remote themselves by calling an + * out-of-process peer implementation with arbitrary data to carry out tasks + * on the implementation's behalf that require isolation from the dynamic process + * fluctuations that web servers are prone to. The ability to pass arbitrary data + * trees across the boundary allows arbitrary separation of duty between the + * in-process and out-of-process "halves". The ListenerService is responsible + * for marshalling and transmitting messages, as well as managing connections + * and communication errors. + */ + class SHIBSP_API ListenerService : public virtual Remoted + { + public: + virtual ~ListenerService() {} + + /** + * Send a remoted message and return the response. + * + * @param in input message to send + * @return response from remote service + */ + virtual DDF send(const DDF& in)=0; + + void receive(DDF& in, std::ostream& out); + + // Remoted classes register and unregister for messages using these methods. + // Registration returns any existing listeners, allowing message hooking. + + /** + * Register for a message. Returns existing remote service, allowing message hooking. + * + * @param address message address to register + * @param svc pointer to remote service + * @return previous service registered for message, if any + */ + virtual Remoted* regListener(const char* address, Remoted* svc); + + /** + * Unregisters service from an address, possibly restoring an original. + * + * @param address message address to modify + * @param current pointer to unregistering service + * @param restore service to "restore" registration for + * @return true iff the current service was still registered + */ + virtual bool unregListener(const char* address, Remoted* current, Remoted* restore=NULL); + + /** + * Returns current service registered at an address, if any. + * + * @param address message address to access + * @return registered service, or NULL + */ + virtual Remoted* lookup(const char* address) const; + + /** + * OutOfProcess servers can implement server-side transport handling by + * calling the run method and supplying a flag to monitor for shutdown. + * + * @param shutdown pointer to flag that caller will set when shutdown is required + * @return true iff ListenerService initialization was successful + */ + virtual bool run(bool* shutdown)=0; + + private: + std::map m_listenerMap; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + + /** + * Registers ListenerService classes into the runtime. + */ + void SHIBSP_API registerListenerServices(); + + /** Listener based on TCP socket remoting. */ + #define TCP_LISTENER_SERVICE "TCPListener" + + /** Listener based on UNIX domain socket remoting. */ + #define UNIX_LISTENER_SERVICE "UnixListener" +}; + +#endif /* __shibsp_listener_h__ */ diff --git a/shibsp/remoting/ddf.h b/shibsp/remoting/ddf.h new file mode 100644 index 0000000..041f344 --- /dev/null +++ b/shibsp/remoting/ddf.h @@ -0,0 +1,161 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/remoting/ddf.h + * + * C++ DDF abstraction for interpretive RPC + */ + +#ifndef __ddf_h__ +#define __ddf_h__ + +#include + +#include +#include + +namespace shibsp { + + /** + * DDF objects are implemented with a handle-body idiom and require explicit + * destruction in order to allow stack objects to be freely mixed in structures + * with heap objects. When stack objects leave scope, only the handle is freed. + * Copying and assigning handle objects is a constant time operation equivalent + * to a single pointer assignment, handled by compiler-generated behavior. + */ + class SHIBSP_API DDF + { + public: + /// @cond OFF + // constructors + DDF() : m_handle(NULL) {} + DDF(const char* n); + DDF(const char* n, const char* val); + DDF(const char* n, long val); + DDF(const char* n, double val); + DDF(const char* n, void* val); + + DDF& destroy(); // deep destructor + DDF copy() const; // deep copy routine + + // property accessors + const char* name() const; DDF& name(const char* n); + + // basic type checking + bool isnull() const; + bool isempty() const; + bool isstring() const; + bool isint() const; + bool isfloat() const; + bool isstruct() const; + bool islist() const; + bool ispointer() const; + + // type conversion and value extraction + const char* string() const; // legal for str + long integer() const; // legal for all types + double floating() const; // legal for float + void* pointer() const; // legal for pointer + + // string helper methods + size_t strlen() const; + bool operator==(const char* s) const; + + // destructive node conversion methods + DDF& empty(); + DDF& string(const char* val) { + return string(const_cast(val), true); + } + DDF& string(char* val, bool copyit=true); + DDF& string(long val); + DDF& string(double val); + DDF& integer(long val); + DDF& integer(const char* val); + DDF& floating(double val); + DDF& floating(const char* val); + DDF& structure(); + DDF& list(); + DDF& pointer(void* val); + + // list/struct methods + DDF& add(DDF& child); + DDF& addbefore(DDF& child, DDF& before); + DDF& addafter(DDF& child, DDF& after); + void swap(DDF& arg); + DDF& remove(); + + // C-style iterators + DDF parent() const; + DDF first(); + DDF next(); + DDF last(); + DDF previous(); + + // indexed operators + DDF operator[](unsigned long index) const; + DDF operator[](const char* path) const { return getmember(path); } + + // named member access/creation + DDF addmember(const char* path); + DDF getmember(const char* path) const; + + // debugging + void dump(FILE* f=NULL, int indent=0) const; + + // serialization functions need private access + friend SHIBSP_API std::ostream& operator<<(std::ostream& os, const DDF& obj); + friend SHIBSP_API std::istream& operator>>(std::istream& is, DDF& obj); + /// @endcond + private: + struct ddf_body_t* m_handle; + }; + + /** + * Serializes a DDF object to a stream. + * + * @param os output stream + * @param obj DDF object to serialize + * @return reference to the output stream + */ + SHIBSP_API std::ostream& operator<<(std::ostream& os, const DDF& obj); + + /** + * Reconstitutes a DDF object from a stream. + * + * @param is input stream + * @param obj DDF object to reconstitute + * @return reference to the input stream + */ + SHIBSP_API std::istream& operator>>(std::istream& is, DDF& obj); + + /** + * A "smart pointer" for disposing of DDF objects when they leave scope. + */ + class SHIBSP_API DDFJanitor + { + public: + DDFJanitor(DDF& obj) : m_obj(obj) {} + ~DDFJanitor() { m_obj.destroy(); } + private: + DDF& m_obj; + DDFJanitor(const DDFJanitor&); + DDFJanitor& operator=(const DDFJanitor&); + }; + +} + +#endif // __ddf_h__ diff --git a/shibsp/remoting/impl/ListenerService.cpp b/shibsp/remoting/impl/ListenerService.cpp new file mode 100644 index 0000000..600c87f --- /dev/null +++ b/shibsp/remoting/impl/ListenerService.cpp @@ -0,0 +1,98 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ListenerService.cpp + * + * Interprocess remoting engine. + */ + +#include "internal.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "remoting/ListenerService.h" + +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +namespace shibsp { + SHIBSP_DLLLOCAL PluginManager::Factory TCPListenerServiceFactory; +#ifndef WIN32 + SHIBSP_DLLLOCAL PluginManager::Factory UnixListenerServiceFactory; +#endif +}; + +void SHIBSP_API shibsp::registerListenerServices() +{ + SPConfig& conf=SPConfig::getConfig(); + conf.ListenerServiceManager.registerFactory(TCP_LISTENER_SERVICE, TCPListenerServiceFactory); +#ifndef WIN32 + conf.ListenerServiceManager.registerFactory(UNIX_LISTENER_SERVICE, UnixListenerServiceFactory); +#endif +} + +Remoted* ListenerService::regListener(const char* address, Remoted* listener) +{ + Remoted* ret=NULL; + map::const_iterator i=m_listenerMap.find(address); + if (i!=m_listenerMap.end()) + ret=i->second; + m_listenerMap[address]=listener; + Category::getInstance(SHIBSP_LOGCAT".Listener").info("registered remoted message endpoint (%s)",address); + return ret; +} + +bool ListenerService::unregListener(const char* address, Remoted* current, Remoted* restore) +{ + map::const_iterator i=m_listenerMap.find(address); + if (i!=m_listenerMap.end() && i->second==current) { + if (restore) + m_listenerMap[address]=restore; + else + m_listenerMap.erase(address); + Category::getInstance(SHIBSP_LOGCAT".Listener").info("unregistered remoted message endpoint (%s)",address); + return true; + } + return false; +} + +Remoted* ListenerService::lookup(const char *address) const +{ + map::const_iterator i=m_listenerMap.find(address); + return (i==m_listenerMap.end()) ? NULL : i->second; +} + +void ListenerService::receive(DDF &in, ostream& out) +{ + if (!in.name()) + throw ListenerException("Incoming message with no destination address rejected."); + else if (!strcmp("ping",in.name())) { + DDF outmsg=DDF(NULL).integer(in.integer() + 1); + DDFJanitor jan(outmsg); + out << outmsg; + } + + Locker locker(SPConfig::getConfig().getServiceProvider()); + Remoted* dest=lookup(in.name()); + if (!dest) + throw ListenerException("No destination registered for incoming message addressed to ($1).",params(1,in.name())); + + dest->receive(in, out); +} diff --git a/shibsp/remoting/impl/SocketListener.cpp b/shibsp/remoting/impl/SocketListener.cpp new file mode 100644 index 0000000..c67492d --- /dev/null +++ b/shibsp/remoting/impl/SocketListener.cpp @@ -0,0 +1,555 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SocketListener.cpp + * + * Berkeley Socket-based ListenerService implementation + */ + +#include "internal.h" +#include "exceptions.h" +#include "ServiceProvider.h" +#include "remoting/impl/SocketListener.h" + +#include +#include +#include +#include +#include + +#ifndef WIN32 +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +using namespace shibsp; +using namespace xmltooling; +using namespace std; +using xercesc::DOMElement; + +namespace shibsp { + + // Manages the pool of connections + class SocketPool + { + public: + SocketPool(Category& log, const SocketListener* listener) + : m_log(log), m_listener(listener), m_lock(Mutex::create()) {} + ~SocketPool(); + SocketListener::ShibSocket get(); + void put(SocketListener::ShibSocket s); + + private: + SocketListener::ShibSocket connect(); + + Category& m_log; + const SocketListener* m_listener; + auto_ptr m_lock; + stack m_pool; + }; + + // Worker threads in server + class ServerThread { + public: + ServerThread(SocketListener::ShibSocket& s, SocketListener* listener, unsigned long id); + ~ServerThread(); + void run(); + int job(); // Return -1 on error, 1 for closed, 0 for success + + private: + SocketListener::ShibSocket m_sock; + Thread* m_child; + SocketListener* m_listener; + string m_id; + char m_buf[16384]; + }; +} + +SocketListener::ShibSocket SocketPool::connect() +{ +#ifdef _DEBUG + NDC ndc("connect"); +#endif + + m_log.debug("trying to connect to listener"); + + SocketListener::ShibSocket sock; + if (!m_listener->create(sock)) { + m_log.error("cannot create socket"); + throw ListenerException("Cannot create socket"); + } + + bool connected = false; + int num_tries = 3; + + for (int i = num_tries-1; i >= 0; i--) { + if (m_listener->connect(sock)) { + connected = true; + break; + } + + m_log.warn("cannot connect socket (%u)...%s", sock, (i > 0 ? "retrying" : "")); + + if (i) { +#ifdef WIN32 + Sleep(2000*(num_tries-i)); +#else + sleep(2*(num_tries-i)); +#endif + } + } + + if (!connected) { + m_log.crit("socket server unavailable, failing"); + m_listener->close(sock); + throw ListenerException("Cannot connect to shibd process, a site adminstrator should be notified."); + } + + m_log.debug("socket (%u) connected successfully", sock); + return sock; +} + +SocketPool::~SocketPool() +{ + while (!m_pool.empty()) { +#ifdef WIN32 + closesocket(m_pool.top()); +#else + ::close(m_pool.top()); +#endif + m_pool.pop(); + } +} + +SocketListener::ShibSocket SocketPool::get() +{ + m_lock->lock(); + if (m_pool.empty()) { + m_lock->unlock(); + return connect(); + } + SocketListener::ShibSocket ret=m_pool.top(); + m_pool.pop(); + m_lock->unlock(); + return ret; +} + +void SocketPool::put(SocketListener::ShibSocket s) +{ + m_lock->lock(); + m_pool.push(s); + m_lock->unlock(); +} + +SocketListener::SocketListener(const DOMElement* e) : m_catchAll(false), log(&Category::getInstance(SHIBSP_LOGCAT".Listener")), + m_socketpool(NULL), m_shutdown(NULL), m_child_lock(NULL), m_child_wait(NULL), m_socket((ShibSocket)0) +{ + // Are we a client? + if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) { + m_socketpool=new SocketPool(*log,this); + } + // Are we a server? + if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) { + m_child_lock = Mutex::create(); + m_child_wait = CondWait::create(); + } +} + +SocketListener::~SocketListener() +{ + delete m_socketpool; + delete m_child_wait; + delete m_child_lock; +} + +bool SocketListener::run(bool* shutdown) +{ +#ifdef _DEBUG + NDC ndc("run"); +#endif + log->info("listener service starting"); + + ServiceProvider* sp = SPConfig::getConfig().getServiceProvider(); + sp->lock(); + const PropertySet* props = sp->getPropertySet("OutOfProcess"); + if (props) { + pair flag = props->getBool("catchAll"); + m_catchAll = flag.first && flag.second; + } + sp->unlock(); + + // Save flag to monitor for shutdown request. + m_shutdown=shutdown; + unsigned long count = 0; + + if (!create(m_socket)) { + log->crit("failed to create socket"); + return false; + } + if (!bind(m_socket,true)) { + this->close(m_socket); + log->crit("failed to bind to socket."); + return false; + } + + while (!*m_shutdown) { + fd_set readfds; + FD_ZERO(&readfds); + FD_SET(m_socket, &readfds); + struct timeval tv = { 0, 0 }; + tv.tv_sec = 5; + + switch (select(m_socket + 1, &readfds, 0, 0, &tv)) { +#ifdef WIN32 + case SOCKET_ERROR: +#else + case -1: +#endif + if (errno == EINTR) continue; + log_error(); + log->error("select() on main listener socket failed"); + return false; + + case 0: + continue; + + default: + { + // Accept the connection. + SocketListener::ShibSocket newsock; + if (!accept(m_socket, newsock)) + log->crit("failed to accept incoming socket connection"); + + // We throw away the result because the children manage themselves... + try { + new ServerThread(newsock,this,++count); + } + catch (...) { + log->crit("error starting new server thread to service incoming request"); + if (!m_catchAll) + *m_shutdown = true; + } + } + } + } + log->info("listener service shutting down"); + + // Wait for all children to exit. + m_child_lock->lock(); + while (!m_children.empty()) + m_child_wait->wait(m_child_lock); + m_child_lock->unlock(); + + this->close(m_socket); + m_socket=(ShibSocket)0; + return true; +} + +DDF SocketListener::send(const DDF& in) +{ +#ifdef _DEBUG + NDC ndc("send"); +#endif + + log->debug("sending message (%s)", in.name() ? in.name() : "unnamed"); + + // Serialize data for transmission. + ostringstream os; + os << in; + string ostr(os.str()); + + // Loop on the RPC in case we lost contact the first time through +#ifdef WIN32 + u_long len; +#else + uint32_t len; +#endif + int retry = 1; + SocketListener::ShibSocket sock; + while (retry >= 0) { + sock = m_socketpool->get(); + + int outlen = ostr.length(); + len = htonl(outlen); + if (send(sock,(char*)&len,sizeof(len)) != sizeof(len) || send(sock,ostr.c_str(),outlen) != outlen) { + log_error(); + this->close(sock); + if (retry) + retry--; + else + throw ListenerException("Failure sending remoted message ($1).", params(1,in.name())); + } + else { + // SUCCESS. + retry = -1; + } + } + + log->debug("send completed, reading response message"); + + // Read the message. + if (recv(sock,(char*)&len,sizeof(len)) != sizeof(len)) { + log->error("error reading size of output message"); + this->close(sock); + throw ListenerException("Failure receiving response to remoted message ($1).", params(1,in.name())); + } + len = ntohl(len); + + char buf[16384]; + int size_read; + stringstream is; + while (len && (size_read = recv(sock, buf, sizeof(buf))) > 0) { + is.write(buf, size_read); + len -= size_read; + } + + if (len) { + log->error("error reading output message from socket"); + this->close(sock); + throw ListenerException("Failure receiving response to remoted message ($1).", params(1,in.name())); + } + + m_socketpool->put(sock); + + // Unmarshall data. + DDF out; + is >> out; + + // Check for exception to unmarshall and throw, otherwise return. + if (out.isstring() && out.name() && !strcmp(out.name(),"exception")) { + // Reconstitute exception object. + DDFJanitor jout(out); + XMLToolingException* except=NULL; + try { + except=XMLToolingException::fromString(out.string()); + log->error("remoted message returned an error: %s", except->what()); + } + catch (XMLToolingException& e) { + log->error("caught XMLToolingException while building the XMLToolingException: %s", e.what()); + log->error("XML was: %s", out.string()); + throw ListenerException("Remote call failed with an unparsable exception."); + } + + auto_ptr wrapper(except); + wrapper->raise(); + } + + return out; +} + +bool SocketListener::log_error() const +{ +#ifdef WIN32 + int rc=WSAGetLastError(); +#else + int rc=errno; +#endif +#ifdef HAVE_STRERROR_R + char buf[256]; + memset(buf,0,sizeof(buf)); + strerror_r(rc,buf,sizeof(buf)); + log->error("socket call resulted in error (%d): %s",rc,isprint(*buf) ? buf : "no message"); +#else + const char* buf=strerror(rc); + log->error("socket call resulted in error (%d): %s",rc,isprint(*buf) ? buf : "no message"); +#endif + return false; +} + +// actual function run in listener on server threads +void* server_thread_fn(void* arg) +{ + ServerThread* child = (ServerThread*)arg; + +#ifndef WIN32 + // First, let's block all signals + Thread::mask_all_signals(); +#endif + + // Run the child until it exits. + child->run(); + + // Now we can clean up and exit the thread. + delete child; + return NULL; +} + +ServerThread::ServerThread(SocketListener::ShibSocket& s, SocketListener* listener, unsigned long id) + : m_sock(s), m_child(NULL), m_listener(listener) +{ + + ostringstream buf; + buf << "[" << id << "]"; + m_id = buf.str(); + + // Create the child thread + m_child = Thread::create(server_thread_fn, (void*)this); + m_child->detach(); +} + +ServerThread::~ServerThread() +{ + // Then lock the children map, remove this socket/thread, signal waiters, and return + m_listener->m_child_lock->lock(); + m_listener->m_children.erase(m_sock); + m_listener->m_child_lock->unlock(); + m_listener->m_child_wait->signal(); + + delete m_child; +} + +void ServerThread::run() +{ + NDC ndc(m_id); + + // Before starting up, make sure we fully "own" this socket. + m_listener->m_child_lock->lock(); + while (m_listener->m_children.find(m_sock)!=m_listener->m_children.end()) + m_listener->m_child_wait->wait(m_listener->m_child_lock); + m_listener->m_children[m_sock] = m_child; + m_listener->m_child_lock->unlock(); + + int result; + fd_set readfds; + struct timeval tv = { 0, 0 }; + + while(!*(m_listener->m_shutdown)) { + FD_ZERO(&readfds); + FD_SET(m_sock, &readfds); + tv.tv_sec = 1; + + switch (select(m_sock+1, &readfds, 0, 0, &tv)) { +#ifdef WIN32 + case SOCKET_ERROR: +#else + case -1: +#endif + if (errno == EINTR) continue; + m_listener->log_error(); + m_listener->log->error("select() on incoming request socket (%u) returned error", m_sock); + return; + + case 0: + break; + + default: + result = job(); + if (result) { + if (result < 0) { + m_listener->log_error(); + m_listener->log->error("I/O failure processing request on socket (%u)", m_sock); + } + m_listener->close(m_sock); + return; + } + } + } +} + +int ServerThread::job() +{ + Category& log = Category::getInstance(SHIBSP_LOGCAT".Listener"); + + bool incomingError = true; // set false once incoming message is received + ostringstream sink; +#ifdef WIN32 + u_long len; +#else + uint32_t len; +#endif + + try { + // Read the message. + int readlength = m_listener->recv(m_sock,(char*)&len,sizeof(len)); + if (readlength == 0) { + log.info("detected socket closure, shutting down worker thread"); + return 1; + } + else if (readlength != sizeof(len)) { + log.error("error reading size of input message"); + return -1; + } + len = ntohl(len); + + int size_read; + stringstream is; + while (len && (size_read = m_listener->recv(m_sock, m_buf, sizeof(m_buf))) > 0) { + is.write(m_buf, size_read); + len -= size_read; + } + + if (len) { + log.error("error reading input message from socket"); + return -1; + } + + // Unmarshall the message. + DDF in; + DDFJanitor jin(in); + is >> in; + + log.debug("dispatching message (%s)", in.name() ? in.name() : "unnamed"); + + incomingError = false; + + // Dispatch the message. + m_listener->receive(in, sink); + } + catch (XMLToolingException& e) { + if (incomingError) + log.error("error processing incoming message: %s", e.what()); + DDF out=DDF("exception").string(e.toString().c_str()); + DDFJanitor jout(out); + sink << out; + } + catch (exception& e) { + if (incomingError) + log.error("error processing incoming message: %s", e.what()); + ListenerException ex(e.what()); + DDF out=DDF("exception").string(ex.toString().c_str()); + DDFJanitor jout(out); + sink << out; + } + catch (...) { + if (incomingError) + log.error("unexpected error processing incoming message"); + if (!m_listener->m_catchAll) + throw; + ListenerException ex("An unexpected error occurred while processing an incoming message."); + DDF out=DDF("exception").string(ex.toString().c_str()); + DDFJanitor jout(out); + sink << out; + } + + // Return whatever's available. + string response(sink.str()); + int outlen = response.length(); + len = htonl(outlen); + if (m_listener->send(m_sock,(char*)&len,sizeof(len)) != sizeof(len)) { + log.error("error sending output message size"); + return -1; + } + if (m_listener->send(m_sock,response.c_str(),outlen) != outlen) { + log.error("error sending output message"); + return -1; + } + + return 0; +} diff --git a/shibsp/remoting/impl/SocketListener.h b/shibsp/remoting/impl/SocketListener.h new file mode 100644 index 0000000..0922cf4 --- /dev/null +++ b/shibsp/remoting/impl/SocketListener.h @@ -0,0 +1,93 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SocketListener.h + * + * Berkeley Socket-based ListenerService implementation + */ + +#ifndef __shibsp_socklisten_h__ +#define __shibsp_socklisten_h__ + +#ifndef FD_SETSIZE +# define FD_SETSIZE 1024 +#endif + +#include + +#include +#include +#include + +#ifdef WIN32 +# include +#endif + +namespace shibsp { + + class SocketPool; + class ServerThread; + + /** + * Berkeley Socket-based ListenerService implementation + */ + class SocketListener : public virtual ListenerService + { + public: + /// @cond OFF + SocketListener(const xercesc::DOMElement* e); + ~SocketListener(); + + DDF send(const DDF& in); + bool run(bool* shutdown); + + // Implemented by socket-specific subclasses. +#ifdef WIN32 + typedef SOCKET ShibSocket; +#else + typedef int ShibSocket; +#endif + virtual bool create(ShibSocket& s) const=0; + virtual bool connect(ShibSocket& s) const=0; + virtual bool bind(ShibSocket& s, bool force=false) const=0; + virtual bool accept(ShibSocket& listener, ShibSocket& s) const=0; + virtual bool close(ShibSocket& s) const=0; + virtual int send(ShibSocket& s, const char* buf, int len) const=0; + virtual int recv(ShibSocket& s, char* buf, int buflen) const=0; + + bool m_catchAll; + protected: + bool log_error() const; // for OS-level errors + xmltooling::logging::Category* log; + /// @endcond + + private: + mutable SocketPool* m_socketpool; + bool* m_shutdown; + + // Manage child threads + friend class ServerThread; + std::map m_children; + xmltooling::Mutex* m_child_lock; + xmltooling::CondWait* m_child_wait; + + // Primary socket + ShibSocket m_socket; + }; +} + +#endif /* __shibsp_socklisten_h__ */ diff --git a/shibsp/remoting/impl/TCPListener.cpp b/shibsp/remoting/impl/TCPListener.cpp new file mode 100644 index 0000000..44828e6 --- /dev/null +++ b/shibsp/remoting/impl/TCPListener.cpp @@ -0,0 +1,215 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TCPListener.cpp + * + * TCP-based SocketListener implementation + */ + +#include "internal.h" +#include "remoting/impl/SocketListener.h" + +#include +#include + +#ifdef HAVE_UNISTD_H +# include +# include +# include +# include +#endif + +#include +#include /* for chmod() */ +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +namespace shibsp { + static const XMLCh address[] = UNICODE_LITERAL_7(a,d,d,r,e,s,s); + static const XMLCh port[] = UNICODE_LITERAL_4(p,o,r,t); + static const XMLCh acl[] = UNICODE_LITERAL_3(a,c,l); + + class TCPListener : virtual public SocketListener + { + public: + TCPListener(const DOMElement* e); + ~TCPListener() {} + + bool create(ShibSocket& s) const; + bool bind(ShibSocket& s, bool force=false) const; + bool connect(ShibSocket& s) const; + bool close(ShibSocket& s) const; + bool accept(ShibSocket& listener, ShibSocket& s) const; + + int send(ShibSocket& s, const char* buf, int len) const { + return ::send(s, buf, len, 0); + } + + int recv(ShibSocket& s, char* buf, int buflen) const { + return ::recv(s, buf, buflen, 0); + } + + private: + void setup_tcp_sockaddr(struct sockaddr_in* addr) const; + + string m_address; + unsigned short m_port; + vector m_acl; + }; + + ListenerService* SHIBSP_DLLLOCAL TCPListenerServiceFactory(const DOMElement* const & e) + { + return new TCPListener(e); + } +}; + +TCPListener::TCPListener(const DOMElement* e) : SocketListener(e), m_address("127.0.0.1"), m_port(12345) +{ + // We're stateless, but we need to load the configuration. + const XMLCh* tag=e->getAttributeNS(NULL,address); + if (tag && *tag) { + auto_ptr_char a(tag); + m_address=a.get(); + } + + tag=e->getAttributeNS(NULL,port); + if (tag && *tag) { + m_port=XMLString::parseInt(tag); + if (m_port==0) + m_port=12345; + } + + tag=e->getAttributeNS(NULL,acl); + if (tag && *tag) { + auto_ptr_char temp(tag); + string sockacl=temp.get(); + if (sockacl.length()) { + int j = 0; + for (unsigned int i=0; i < sockacl.length(); i++) { + if (sockacl.at(i)==' ') { + m_acl.push_back(sockacl.substr(j, i-j)); + j = i+1; + } + } + m_acl.push_back(sockacl.substr(j, sockacl.length()-j)); + } + } + else + m_acl.push_back("127.0.0.1"); +} + +void TCPListener::setup_tcp_sockaddr(struct sockaddr_in* addr) const +{ + // Split on host:port boundary. Default to port only. + memset(addr,0,sizeof(struct sockaddr_in)); + addr->sin_family=AF_INET; + addr->sin_port=htons(m_port); + addr->sin_addr.s_addr=inet_addr(m_address.c_str()); +} + +bool TCPListener::create(ShibSocket& s) const +{ + s=socket(AF_INET,SOCK_STREAM,0); +#ifdef WIN32 + if(s==INVALID_SOCKET) +#else + if (s < 0) +#endif + return log_error(); + return true; +} + +bool TCPListener::bind(ShibSocket& s, bool force) const +{ + struct sockaddr_in addr; + setup_tcp_sockaddr(&addr); + + // XXX: Do we care about the return value from setsockopt? + int opt = 1; + ::setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char*)&opt, sizeof(opt)); + +#ifdef WIN32 + if (SOCKET_ERROR==::bind(s,(struct sockaddr *)&addr,sizeof(addr)) || SOCKET_ERROR==::listen(s,3)) { + log_error(); + close(s); + return false; + } +#else + if (::bind(s, (struct sockaddr *)&addr, sizeof (addr)) < 0) { + log_error(); + close(s); + return false; + } + ::listen(s,3); +#endif + return true; +} + +bool TCPListener::connect(ShibSocket& s) const +{ + struct sockaddr_in addr; + setup_tcp_sockaddr(&addr); +#ifdef WIN32 + if(SOCKET_ERROR==::connect(s,(struct sockaddr *)&addr,sizeof(addr))) + return log_error(); +#else + if (::connect(s, (struct sockaddr*)&addr, sizeof (addr)) < 0) + return log_error(); +#endif + return true; +} + +bool TCPListener::close(ShibSocket& s) const +{ +#ifdef WIN32 + closesocket(s); +#else + ::close(s); +#endif + return true; +} + +bool TCPListener::accept(ShibSocket& listener, ShibSocket& s) const +{ + struct sockaddr_in addr; + +#ifdef WIN32 + int size=sizeof(addr); + s=::accept(listener,(struct sockaddr*)&addr,&size); + if(s==INVALID_SOCKET) +#else + socklen_t size=sizeof(addr); + s=::accept(listener,(struct sockaddr*)&addr,&size); + if (s < 0) +#endif + return log_error(); + char* client=inet_ntoa(addr.sin_addr); + for (vector::const_iterator i=m_acl.begin(); i!=m_acl.end(); i++) { + if (*i==client) + return true; + } + close(s); + s=-1; + log->error("accept() rejected client at %s\n",client); + return false; +} diff --git a/shibsp/remoting/impl/UnixListener.cpp b/shibsp/remoting/impl/UnixListener.cpp new file mode 100644 index 0000000..1180e27 --- /dev/null +++ b/shibsp/remoting/impl/UnixListener.cpp @@ -0,0 +1,159 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * UnixListener.cpp + * + * Unix Domain-based SocketListener implementation + */ + +#include "internal.h" +#include "remoting/impl/SocketListener.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +# include +# include +# include +#endif + +#include +#include /* for chmod() */ +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + + +namespace shibsp { + static const XMLCh address[] = UNICODE_LITERAL_7(a,d,d,r,e,s,s); + + class UnixListener : virtual public SocketListener + { + public: + UnixListener(const DOMElement* e); + ~UnixListener() {if (m_bound) unlink(m_address.c_str());} + + bool create(ShibSocket& s) const; + bool bind(ShibSocket& s, bool force=false) const; + bool connect(ShibSocket& s) const; + bool close(ShibSocket& s) const; + bool accept(ShibSocket& listener, ShibSocket& s) const; + + int send(ShibSocket& s, const char* buf, int len) const { + return ::send(s, buf, len, 0); + } + + int recv(ShibSocket& s, char* buf, int buflen) const { + return ::recv(s, buf, buflen, 0); + } + + private: + string m_address; + mutable bool m_bound; + }; + + ListenerService* SHIBSP_DLLLOCAL UnixListenerServiceFactory(const DOMElement* const & e) + { + return new UnixListener(e); + } +}; + +UnixListener::UnixListener(const DOMElement* e) : SocketListener(e), m_address("/var/run/shar-socket"), m_bound(false) +{ + const XMLCh* tag=e->getAttributeNS(NULL,address); + if (tag && *tag) { + auto_ptr_char a(tag); + m_address=a.get(); + XMLToolingConfig::getConfig().getPathResolver()->resolve(m_address, PathResolver::XMLTOOLING_RUN_FILE); + } +} + +#ifndef UNIX_PATH_MAX +#define UNIX_PATH_MAX 100 +#endif + +bool UnixListener::create(ShibSocket& sock) const +{ + sock = socket(PF_UNIX, SOCK_STREAM, 0); + if (sock < 0) + return log_error(); + return true; +} + +bool UnixListener::bind(ShibSocket& s, bool force) const +{ + struct sockaddr_un addr; + memset(&addr, 0, sizeof (addr)); + addr.sun_family = AF_UNIX; + strncpy(addr.sun_path, m_address.c_str(), UNIX_PATH_MAX); + + if (force) + unlink(m_address.c_str()); + + if (::bind(s, (struct sockaddr *)&addr, sizeof (addr)) < 0) { + log_error(); + close(s); + return false; + } + + // Make sure that only the creator can read -- we don't want just + // anyone connecting, do we? + if (chmod(m_address.c_str(),0777) < 0) { + log_error(); + close(s); + unlink(m_address.c_str()); + return false; + } + + listen(s, 3); + return m_bound=true; +} + +bool UnixListener::connect(ShibSocket& s) const +{ + struct sockaddr_un addr; + memset(&addr, 0, sizeof (addr)); + addr.sun_family = AF_UNIX; + strncpy(addr.sun_path, m_address.c_str(), UNIX_PATH_MAX); + + if (::connect(s, (struct sockaddr *)&addr, sizeof (addr)) < 0) + return log_error(); + return true; +} + +bool UnixListener::close(ShibSocket& s) const +{ + ::close(s); + return true; +} + +bool UnixListener::accept(ShibSocket& listener, ShibSocket& s) const +{ + s=::accept(listener,NULL,NULL); + if (s < 0) + return log_error(); + return true; +} diff --git a/shibsp/remoting/impl/ddf.cpp b/shibsp/remoting/impl/ddf.cpp new file mode 100644 index 0000000..463bb8c --- /dev/null +++ b/shibsp/remoting/impl/ddf.cpp @@ -0,0 +1,1011 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ddf.cpp + * + * C++ DDF abstraction for interpretive RPC + */ + +#include "internal.h" +#include "remoting/ddf.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +// defensive string functions + +size_t ddf_strlen(const char* s) +{ + return s ? strlen(s) : 0; +} + +char* ddf_strdup(const char* s) +{ + return (s && *s) ? strdup(s) : NULL; +} + +#define MAX_NAME_LEN 255 + +/* Parses '.' notation paths, where each component is at most MAX_NAME_LEN long. + path contains the address of a constant string which is the current path. + name points to a buffer in which to place the first path component. + After execution, the path pointer will be moved past the first dot. + The actual path string is never modified. Only name is written to. + The name buffer is returned from the function. */ +char* ddf_token(const char** path, char* name) +{ + const char* temp=NULL; + + *name='\0'; + if (*path==NULL || **path=='\0') + return name; + + temp=strchr(*path,'.'); + if (temp==NULL) + { + strcpy(name,*path); + *path=NULL; + } + else if (temp>*path) + { + strncpy(name,*path,temp-*path); + name[temp-*path]='\0'; + *path=temp+1; + } + else + *path=temp+1; + return name; +} + +// body implementation + +struct shibsp::ddf_body_t { + ddf_body_t() : name(NULL), parent(NULL), next(NULL), prev(NULL), type(DDF_EMPTY) {} + + char* name; // name of node + ddf_body_t* parent; // parent node, if any + ddf_body_t* next; // next node, if any + ddf_body_t* prev; // previous node, if any + + enum { + DDF_EMPTY, + DDF_STRING, + DDF_INT, + DDF_FLOAT, + DDF_STRUCT, + DDF_LIST, + DDF_POINTER + } type; // data type of node + + union { + char* string; + long integer; + double floating; + void* pointer; + struct { + ddf_body_t* first; + ddf_body_t* last; + ddf_body_t* current; + unsigned long count; + } children; + } value; // value of node +}; + +// library implementation + +DDF::DDF(const char* n) +{ + m_handle=new(nothrow) ddf_body_t; + name(n); +} + +DDF::DDF(const char* n, const char* val) +{ + m_handle=new(nothrow) ddf_body_t; + name(n); + string(val); +} + +DDF::DDF(const char* n, long val) +{ + m_handle=new(nothrow) ddf_body_t; + name(n); + integer(val); +} + +DDF::DDF(const char* n, double val) +{ + m_handle=new(nothrow) ddf_body_t; + name(n); + floating(val); +} + +DDF::DDF(const char* n, void* val) +{ + m_handle=new(nothrow) ddf_body_t; + name(n); + pointer(val); +} + +DDF& DDF::destroy() +{ + remove().empty().name(NULL); + delete m_handle; + m_handle=NULL; + return *this; +} + +DDF DDF::copy() const +{ + if (m_handle==NULL) + return DDF(); + + switch (m_handle->type) { + case ddf_body_t::DDF_EMPTY: + return DDF(m_handle->name); + case ddf_body_t::DDF_STRING: + return DDF(m_handle->name,m_handle->value.string); + case ddf_body_t::DDF_INT: + return DDF(m_handle->name,m_handle->value.integer); + case ddf_body_t::DDF_FLOAT: + return DDF(m_handle->name,m_handle->value.floating); + case ddf_body_t::DDF_POINTER: + return DDF(m_handle->name,m_handle->value.pointer); + case ddf_body_t::DDF_STRUCT: + case ddf_body_t::DDF_LIST: + { + DDF copy(m_handle->name), temp; + if (m_handle->type==ddf_body_t::DDF_STRUCT) + copy.structure(); + else + copy.list(); + ddf_body_t* child=m_handle->value.children.first; + while (child) { + temp.m_handle=child; + DDF temp2=temp.copy(); + copy.add(temp2); + if (copy.m_handle==NULL) + return copy; + if (m_handle->value.children.current==child) + copy.m_handle->value.children.current=copy.m_handle->value.children.last; + child=child->next; + } + return copy; + } + } + return DDF(); +} + +const char* DDF::name() const +{ + return (m_handle) ? m_handle->name : NULL; +} + +DDF& DDF::name(const char* name) +{ + char trunc_name[MAX_NAME_LEN+1]=""; + + if (m_handle) { + if (m_handle->name) + free(m_handle->name); + if (name && *name) { + strncpy(trunc_name,name,MAX_NAME_LEN); + trunc_name[MAX_NAME_LEN]='\0'; + m_handle->name=ddf_strdup(trunc_name); + if (!m_handle->name) + destroy(); + } + else + m_handle->name=NULL; + } + return *this; +} + +bool DDF::isnull() const +{ + return m_handle ? false : true; +} + +bool DDF::isempty() const +{ + return m_handle ? (m_handle->type==ddf_body_t::DDF_EMPTY) : false; +} + +bool DDF::isstring() const +{ + return m_handle ? (m_handle->type==ddf_body_t::DDF_STRING) : false; +} + +bool DDF::isint() const +{ + return m_handle ? (m_handle->type==ddf_body_t::DDF_INT) : false; +} + +bool DDF::isfloat() const +{ + return m_handle ? (m_handle->type==ddf_body_t::DDF_FLOAT) : false; +} + +bool DDF::isstruct() const +{ + return m_handle ? (m_handle->type==ddf_body_t::DDF_STRUCT) : false; +} + +bool DDF::islist() const +{ + return m_handle ? (m_handle->type==ddf_body_t::DDF_LIST) : false; +} + +bool DDF::ispointer() const +{ + return m_handle ? (m_handle->type==ddf_body_t::DDF_POINTER) : false; +} + +const char* DDF::string() const +{ + return isstring() ? m_handle->value.string : NULL; +} + +long DDF::integer() const +{ + if (m_handle) { + switch(m_handle->type) { + case ddf_body_t::DDF_INT: + return m_handle->value.integer; + case ddf_body_t::DDF_FLOAT: + return static_cast(m_handle->value.floating); + case ddf_body_t::DDF_STRING: + return m_handle->value.string ? atol(m_handle->value.string) : 0; + case ddf_body_t::DDF_STRUCT: + case ddf_body_t::DDF_LIST: + return m_handle->value.children.count; + } + } + return 0; +} + +double DDF::floating() const +{ + if (m_handle) { + switch(m_handle->type) { + case ddf_body_t::DDF_INT: + return m_handle->value.integer; + case ddf_body_t::DDF_FLOAT: + return m_handle->value.floating; + case ddf_body_t::DDF_STRING: + return m_handle->value.string ? atof(m_handle->value.string) : 0; + case ddf_body_t::DDF_STRUCT: + case ddf_body_t::DDF_LIST: + return m_handle->value.children.count; + } + } + return 0; +} + +void* DDF::pointer() const +{ + return ispointer() ? m_handle->value.pointer : NULL; +} + +size_t DDF::strlen() const +{ + return ddf_strlen(string()); +} + +bool DDF::operator==(const char* s) const +{ + if (string()==NULL || s==NULL) + return (string()==NULL && s==NULL); + else + return (::strcmp(string(),s)==0); +} + +DDF& DDF::empty() +{ + if (m_handle) { + switch (m_handle->type) { + case ddf_body_t::DDF_STRING: + if (m_handle->value.string) + free(m_handle->value.string); + break; + case ddf_body_t::DDF_LIST: + case ddf_body_t::DDF_STRUCT: + { + DDF temp; + while (m_handle->value.children.first) + { + temp.m_handle=m_handle->value.children.first; + temp.destroy(); + } + } + } + m_handle->type=ddf_body_t::DDF_EMPTY; + } + return *this; +} + +DDF& DDF::string(char* val, bool copyit) +{ + if (empty().m_handle) { + m_handle->value.string = copyit ? ddf_strdup(val) : val; + if (!m_handle->value.string && val && *val) + return destroy(); + m_handle->type=ddf_body_t::DDF_STRING; + } + return *this; +} + +DDF& DDF::string(long val) +{ + char buf[20]; + + sprintf(buf,"%ld",val); + return string(buf); +} + +DDF& DDF::string(double val) +{ + char buf[40]; + + snprintf(buf,39,"%f",val); + return string(buf); +} + +DDF& DDF::integer(long val) +{ + if (empty().m_handle) { + m_handle->value.integer=val; + m_handle->type=ddf_body_t::DDF_INT; + } + return *this; +} + +DDF& DDF::integer(const char* val) +{ + if (empty().m_handle) { + m_handle->value.integer=(val ? atol(val) : 0); + m_handle->type=ddf_body_t::DDF_INT; + } + return *this; +} + +DDF& DDF::floating(double val) +{ + if (empty().m_handle) { + m_handle->value.floating=val; + m_handle->type=ddf_body_t::DDF_FLOAT; + } + return *this; +} + +DDF& DDF::floating(const char* val) +{ + if (empty().m_handle) { + m_handle->value.floating=(val ? atof(val) : 0); + m_handle->type=ddf_body_t::DDF_FLOAT; + } + return *this; +} + +DDF& DDF::structure() +{ + if (empty().m_handle) { + m_handle->type=ddf_body_t::DDF_STRUCT; + m_handle->value.children.first=NULL; + m_handle->value.children.last=NULL; + m_handle->value.children.current=NULL; + m_handle->value.children.count=0; + } + return *this; +} + +DDF& DDF::list() +{ + if (empty().m_handle) { + m_handle->type=ddf_body_t::DDF_LIST; + m_handle->value.children.first=NULL; + m_handle->value.children.last=NULL; + m_handle->value.children.current=NULL; + m_handle->value.children.count=0; + } + return *this; +} + +DDF& DDF::pointer(void* val) +{ + if (empty().m_handle) { + m_handle->value.pointer=val; + m_handle->type=ddf_body_t::DDF_POINTER; + } + return *this; +} + +DDF& DDF::add(DDF& child) +{ + if ((!isstruct() && !islist()) || !child.m_handle) + return child; + + if (m_handle==child.m_handle->parent) + return child; + + if (isstruct()) { + if (!child.name()) + return child; + getmember(child.name()).destroy(); + } + + child.remove(); + if (!m_handle->value.children.first) + m_handle->value.children.first=child.m_handle; + else { + m_handle->value.children.last->next=child.m_handle; + child.m_handle->prev=m_handle->value.children.last; + } + m_handle->value.children.last=child.m_handle; + child.m_handle->parent=m_handle; + m_handle->value.children.count++; + return child; +} + +DDF& DDF::addbefore(DDF& child, DDF& before) +{ + if (!islist() || !child.m_handle || !before.m_handle || before.m_handle->parent!=m_handle) + return child; + + child.remove(); + if (m_handle->value.children.first==before.m_handle) + m_handle->value.children.first=child.m_handle; + child.m_handle->prev=before.m_handle->prev; + if (child.m_handle->prev) + child.m_handle->prev->next=child.m_handle; + before.m_handle->prev=child.m_handle; + child.m_handle->next=before.m_handle; + child.m_handle->parent=m_handle; + m_handle->value.children.count++; + return child; +} + +DDF& DDF::addafter(DDF& child, DDF& after) +{ + if (!islist() || !child.m_handle || !after.m_handle || after.m_handle->parent!=m_handle) + return child; + + child.remove(); + if (m_handle->value.children.last==after.m_handle) + m_handle->value.children.last=child.m_handle; + child.m_handle->next=after.m_handle->next; + if (child.m_handle->next) + child.m_handle->next->prev=child.m_handle; + after.m_handle->next=child.m_handle; + child.m_handle->prev=after.m_handle; + child.m_handle->parent=m_handle; + m_handle->value.children.count++; + return child; +} + +void DDF::swap(DDF& arg) +{ + ddf_body_t* temp=arg.m_handle; + arg.m_handle=m_handle; + m_handle=temp; +} + +DDF& DDF::remove() +{ + if (!m_handle || !m_handle->parent) + return *this; + + if (m_handle->next) + m_handle->next->prev=m_handle->prev; + + if (m_handle->prev) + m_handle->prev->next=m_handle->next; + + if (m_handle->parent->value.children.first==m_handle) + m_handle->parent->value.children.first=m_handle->next; + + if (m_handle->parent->value.children.last==m_handle) + m_handle->parent->value.children.last=m_handle->prev; + + if (m_handle->parent->value.children.current==m_handle) + m_handle->parent->value.children.current=m_handle->prev; + + m_handle->parent->value.children.count--; + m_handle->parent=NULL; + m_handle->next=NULL; + m_handle->prev=NULL; + return *this; +} + +DDF DDF::parent() const +{ + DDF p; + + p.m_handle=(m_handle ? m_handle->parent : NULL); + return p; +} + +DDF DDF::first() +{ + DDF f; + + if (islist() || isstruct()) + f.m_handle=m_handle->value.children.current=m_handle->value.children.first; + return f; +} + +DDF DDF::next() +{ + DDF n; + + if ((islist() || isstruct()) && m_handle->value.children.current!=m_handle->value.children.last) { + if (!m_handle->value.children.current) + n.m_handle=m_handle->value.children.current=m_handle->value.children.first; + else + n.m_handle=m_handle->value.children.current=m_handle->value.children.current->next; + } + return n; +} + +DDF DDF::last() +{ + DDF l; + + if ((islist() || isstruct()) && m_handle->value.children.last) { + m_handle->value.children.current=m_handle->value.children.last->prev; + l.m_handle=m_handle->value.children.last; + } + return l; +} + +DDF DDF::previous() +{ + DDF p; + + if (islist() || isstruct()) { + p.m_handle=m_handle->value.children.current; + if (p.m_handle) + m_handle->value.children.current=m_handle->value.children.current->prev; + } + return p; +} + +DDF DDF::operator[](unsigned long index) const +{ + DDF d; + + if (islist() && indexvalue.children.count) { + for (d.m_handle=m_handle->value.children.first; index; index--) + d.m_handle=d.m_handle->next; + } + else + throw range_error("DDF object not a list with >=index+1 elements"); + return d; +} + +DDF DDF::addmember(const char* path) +{ + char name[MAX_NAME_LEN+1]; + const char* path_ptr=path; + + if (m_handle && ddf_strlen(ddf_token(&path_ptr,name))>0) { + if (!isstruct()) + structure(); + + DDF new_member=getmember(name); + if (!new_member.m_handle) { + DDF temp(name); + new_member=add(temp); + } + + if (new_member.m_handle) { + if (ddf_strlen(path_ptr)>0) { + DDF last_member=new_member.addmember(path_ptr); + if (!last_member.m_handle) + return new_member.destroy(); + else + return last_member; + } + return new_member; + } + return new_member; + } + return DDF(); +} + +DDF DDF::getmember(const char* path) const +{ + char name[MAX_NAME_LEN+1]; + const char* path_ptr=path; + DDF current; + + if (isstruct() && ddf_strlen(ddf_token(&path_ptr,name))>0) { + current.m_handle=m_handle->value.children.first; + while (current.m_handle && strcmp(current.m_handle->name,name)!=0) + current.m_handle=current.m_handle->next; + + if (current.m_handle && ddf_strlen(path_ptr)>0) + current=current.getmember(path_ptr); + } + return current; +} + + +void ddf_print_indent(FILE* f, int indent) +{ + for (; indent>0; indent--) + putc(' ',f); +} + +void DDF::dump(FILE* f, int indent) const +{ + if (!f) + f=stderr; + + ddf_print_indent(f,indent); + if (m_handle) { + switch (m_handle->type) { + + case ddf_body_t::DDF_EMPTY: + fprintf(f,"empty"); + if (m_handle->name) + fprintf(f," %s",m_handle->name); + break; + + case ddf_body_t::DDF_STRING: + if (m_handle->name) + fprintf(f,"char* %s = ",m_handle->name); + else + fprintf(f,"char* = "); + if (const char* chptr=m_handle->value.string) { + putc('"',f); + while (*chptr) + fputc(*chptr++,f); + putc('"',f); + } + else + fprintf(f,"NULL"); + break; + + case ddf_body_t::DDF_INT: + if (m_handle->name) + fprintf(f,"long %s = ",m_handle->name); + else + fprintf(f,"long = "); + fprintf(f,"%ld",m_handle->value.integer); + break; + + case ddf_body_t::DDF_FLOAT: + if (m_handle->name) + fprintf(f,"double %s = ",m_handle->name); + else + fprintf(f,"double = "); + fprintf(f,"%.15f",m_handle->value.floating); + break; + + case ddf_body_t::DDF_STRUCT: + fprintf(f,"struct "); + if (m_handle->name) + fprintf(f,"%s ",m_handle->name); + putc('{',f); + if (m_handle->value.children.count) { + putc('\n',f); + DDF child; + child.m_handle=m_handle->value.children.first; + while (child.m_handle) { + child.dump(f,indent+2); + child.m_handle=child.m_handle->next; + } + } + ddf_print_indent(f,indent); + putc('}',f); + break; + + case ddf_body_t::DDF_LIST: + fprintf(f,"list"); + if (m_handle->name) + fprintf(f," %s",m_handle->name); + fprintf(f,"[%lu] {",m_handle->value.children.count); + if (m_handle->value.children.count) { + putc('\n',f); + DDF child; + child.m_handle=m_handle->value.children.first; + while (child.m_handle) { + child.dump(f,indent+2); + child.m_handle=child.m_handle->next; + } + } + ddf_print_indent(f,indent); + putc('}',f); + break; + + case ddf_body_t::DDF_POINTER: + if (m_handle->name) + fprintf(f,"void* %s = ",m_handle->name); + else + fprintf(f,"void* = "); + if (m_handle->value.pointer) + fprintf(f,"%p",m_handle->value.pointer); + else + fprintf(f,"NULL"); + break; + + default: + fprintf(f,"UNKNOWN -- WARNING: ILLEGAL VALUE"); + } + } + else + fprintf(f,"NULL"); + fprintf(f,";\n"); +} + +// Serialization is fairly easy. We have to walk the DDF and hand-generate a +// wddxPacket XML fragment, with some simple extensions. We escape the four major +// special characters, which requires that we output strings one char at a time. + +void xml_encode(ostream& os, const char* start) +{ + size_t pos; + while (start && *start) { + pos = strcspn(start, "\"<>&"); + if (pos > 0) { + os.write(start,pos); + start += pos; + } + else { + switch (*start) { + case '"': os << """; break; + case '<': os << "<"; break; + case '>': os << ">"; break; + case '&': os << "&"; break; + default: os << *start; + } + start++; + } + } +} + +void serialize(ddf_body_t* p, ostream& os, bool name_attr=true) +{ + if (p) { + switch (p->type) { + + case ddf_body_t::DDF_STRING: + os << "name) { + os << " name=\""; + xml_encode(os,p->name); + os << '"'; + } + if (p->value.string) { + os << '>'; + xml_encode(os,p->value.string); + os << ""; + } + else + os << "/>"; + break; + + case ddf_body_t::DDF_INT: + os << "name) { + os << " name=\""; + xml_encode(os,p->name); + os << '"'; + } + os << '>' << p->value.integer << ""; + break; + + case ddf_body_t::DDF_FLOAT: + os << "name) { + os << " name=\""; + xml_encode(os,p->name); + os << '"'; + } + os << '>' << fixed << p->value.floating << dec << ""; + break; + + case ddf_body_t::DDF_STRUCT: + { + os << "name) { + os << " name=\""; + xml_encode(os,p->name); + os << '"'; + } + os << '>'; + ddf_body_t* child=p->value.children.first; + while (child) { + os << "name); + os << "\">"; + serialize(child,os,false); + os << ""; + child=child->next; + } + os << ""; + break; + } + + case ddf_body_t::DDF_LIST: + { + os << "value.children.count << '"'; + if (name_attr && p->name) { + os << " name=\""; + xml_encode(os,p->name); + os << '"'; + } + os << '>'; + ddf_body_t* child=p->value.children.first; + while (child) { + serialize(child,os); + child=child->next; + } + os << ""; + break; + } + + case ddf_body_t::DDF_EMPTY: + case ddf_body_t::DDF_POINTER: + default: + os << "name) { + os << " name=\""; + xml_encode(os,p->name); + os << '"'; + } + os << "/>"; + break; + } + } + else + os << ""; +} + +// The stream insertion will work for any ostream-based object. + +SHIBSP_API ostream& shibsp::operator<<(ostream& os, const DDF& obj) +{ + os.precision(15); + os << "
"; + serialize(obj.m_handle,os); + os << ""; + return os; +} + +// This is a DTD internal subset based on a compatible permutation of the WDDX spec, with the +// extension of a name attribute on all the typed elements, which DDF has, but WDDX does not. + +/* +static const char* g_DocType= +"\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +\n\ +]>\n"; +*/ + +// This function constructs a DDF object equivalent to the wddx data element rooted +// by the input. + +static const XMLCh _no[] = UNICODE_LITERAL_2(n,o); +static const XMLCh _name[] = UNICODE_LITERAL_4(n,a,m,e); +static const XMLCh _var[] = UNICODE_LITERAL_3(v,a,r); +static const XMLCh _string[] = UNICODE_LITERAL_6(s,t,r,i,n,g); +static const XMLCh _number[] = UNICODE_LITERAL_6(n,u,m,b,e,r); +static const XMLCh _array[] = UNICODE_LITERAL_5(a,r,r,a,y); +static const XMLCh _struct[] = UNICODE_LITERAL_6(s,t,r,u,c,t); +static const XMLCh _lowercase[] = UNICODE_LITERAL_9(l,o,w,e,r,c,a,s,e); + +DDF deserialize(DOMElement* root, bool lowercase) +{ + DDF obj(NULL); + auto_ptr_char name_val(root->getAttribute(_name)); + if (name_val.get() && *name_val.get()) { + if (lowercase) + for (char* pch=const_cast(name_val.get()); *pch=tolower(*pch); pch++); + obj.name(name_val.get()); + } + + const XMLCh* tag=root->getTagName(); + if (XMLString::equals(tag,_var)) { + root=XMLHelper::getFirstChildElement(root); + tag=(root ? root->getTagName() : &chNull); + } + + if (XMLString::equals(tag,_string)) { + DOMNode* child=root->getFirstChild(); + if (child && child->getNodeType()==DOMNode::TEXT_NODE) { + char* val = toUTF8(child->getNodeValue(), true); // use malloc + if (val) + obj.string(val, false); // don't re-copy the string + } + } + else if (XMLString::equals(tag,_number)) { + DOMNode* child=root->getFirstChild(); + if (child && child->getNodeType()==DOMNode::TEXT_NODE) { + auto_ptr_char val(child->getNodeValue()); + if (val.get() && strchr(val.get(),'.')) + obj.floating(val.get()); + else + obj.integer(val.get()); + } + } + else if (XMLString::equals(tag,_array)) { + obj.list(); + DOMNodeList* children=root->getChildNodes(); + for (unsigned int i=0; children && igetLength(); i++) + if (children->item(i)->getNodeType()==DOMNode::ELEMENT_NODE) { + DDF temp=deserialize(static_cast(children->item(i)),lowercase); + obj.add(temp); + } + } + else if (XMLString::equals(tag,_struct)) { + obj.structure(); + DOMNodeList* children=root->getChildNodes(); + for (unsigned int i=0; children && igetLength(); i++) + if (children->item(i)->getNodeType()==DOMNode::ELEMENT_NODE) { + DDF temp=deserialize(static_cast(children->item(i)),lowercase); + obj.add(temp); + } + } + + return obj; +} + +SHIBSP_API istream& shibsp::operator>>(istream& is, DDF& obj) +{ + // Parse the input stream into a DOM tree and construct the equivalent DDF. + DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(is); + XercesJanitor docj(doc); + const XMLCh* lowercase=doc->getDocumentElement()->getAttribute(_lowercase); + DOMElement* first=XMLHelper::getFirstChildElement(XMLHelper::getLastChildElement(doc->getDocumentElement())); + obj.destroy(); + obj=deserialize(first,XMLString::compareString(lowercase,_no)!=0); + return is; +} diff --git a/shibsp/resource.h b/shibsp/resource.h new file mode 100644 index 0000000..8df1c2f --- /dev/null +++ b/shibsp/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by shibsp.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/shibsp/security/PKIXTrustEngine.cpp b/shibsp/security/PKIXTrustEngine.cpp new file mode 100644 index 0000000..c8ed9bc --- /dev/null +++ b/shibsp/security/PKIXTrustEngine.cpp @@ -0,0 +1,287 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * PKIXTrustEngine.cpp + * + * Shibboleth-specific PKIX-validation TrustEngine + */ + +#include "internal.h" +#include "metadata/MetadataExt.h" +#include "security/PKIXTrustEngine.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace xmlsignature; +using namespace xmltooling; +using namespace std; + +namespace shibsp { + + class SHIBSP_DLLLOCAL PKIXTrustEngine : public AbstractPKIXTrustEngine, public ObservableMetadataProvider::Observer + { + public: + PKIXTrustEngine(const DOMElement* e=NULL) : AbstractPKIXTrustEngine(e), m_credLock(RWLock::create()) { + } + virtual ~PKIXTrustEngine() { + for (map::iterator i=m_credentialMap.begin(); i!=m_credentialMap.end(); ++i) { + i->first->removeObserver(this); + for (credmap_t::iterator creds = i->second.begin(); creds!=i->second.end(); ++creds) + for_each(creds->second.begin(), creds->second.end(), xmltooling::cleanup()); + } + delete m_credLock; + } + + AbstractPKIXTrustEngine::PKIXValidationInfoIterator* getPKIXValidationInfoIterator( + const CredentialResolver& pkixSource, CredentialCriteria* criteria=NULL + ) const; + + void onEvent(const ObservableMetadataProvider& metadata) const { + // Destroy credentials we cached from this provider. + m_credLock->wrlock(); + credmap_t& cmap = m_credentialMap[&metadata]; + for (credmap_t::iterator creds = cmap.begin(); creds!=cmap.end(); ++creds) + for_each(creds->second.begin(), creds->second.end(), xmltooling::cleanup()); + cmap.clear(); + m_credLock->unlock(); + } + + const KeyInfoResolver* getKeyInfoResolver() const { + return m_keyInfoResolver ? m_keyInfoResolver : XMLToolingConfig::getConfig().getKeyInfoResolver(); + } + + private: + friend class SHIBSP_DLLLOCAL MetadataPKIXIterator; + mutable RWLock* m_credLock; + typedef map< const KeyAuthority*,vector > credmap_t; + mutable map m_credentialMap; + }; + + SHIBSP_DLLLOCAL PluginManager::Factory PKIXTrustEngineFactory; + + TrustEngine* SHIBSP_DLLLOCAL PKIXTrustEngineFactory(const DOMElement* const & e) + { + return new PKIXTrustEngine(e); + } + + class SHIBSP_DLLLOCAL MetadataPKIXIterator : public AbstractPKIXTrustEngine::PKIXValidationInfoIterator + { + public: + MetadataPKIXIterator(const PKIXTrustEngine& engine, const MetadataProvider& pkixSource, MetadataCredentialCriteria& criteria); + + virtual ~MetadataPKIXIterator() { + if (m_caching) + m_engine.m_credLock->unlock(); + for_each(m_ownedCreds.begin(), m_ownedCreds.end(), xmltooling::cleanup()); + } + + bool next(); + + int getVerificationDepth() const { + pair vd = m_current->getVerifyDepth(); + return vd.first ? vd.second : 1; + } + + const vector& getTrustAnchors() const { + return m_certs; + } + + const vector& getCRLs() const { + return m_crls; + } + + private: + void populate(); + bool m_caching; + const PKIXTrustEngine& m_engine; + map::iterator m_credCache; + const XMLObject* m_obj; + const Extensions* m_extBlock; + const KeyAuthority* m_current; + vector::const_iterator m_iter; + vector m_certs; + vector m_crls; + vector m_ownedCreds; + }; +}; + +void shibsp::registerPKIXTrustEngine() +{ + XMLToolingConfig::getConfig().TrustEngineManager.registerFactory(SHIBBOLETH_PKIX_TRUSTENGINE, PKIXTrustEngineFactory); +} + +AbstractPKIXTrustEngine::PKIXValidationInfoIterator* PKIXTrustEngine::getPKIXValidationInfoIterator( + const CredentialResolver& pkixSource, CredentialCriteria* criteria + ) const +{ + // Make sure these are metadata objects. + const MetadataProvider& metadata = dynamic_cast(pkixSource); + MetadataCredentialCriteria* metacrit = dynamic_cast(criteria); + if (!metacrit) + throw MetadataException("Cannot obtain PKIX information without a MetadataCredentialCriteria object."); + + return new MetadataPKIXIterator(*this, metadata,*metacrit); +} + +MetadataPKIXIterator::MetadataPKIXIterator( + const PKIXTrustEngine& engine, const MetadataProvider& pkixSource, MetadataCredentialCriteria& criteria + ) : m_caching(false), m_engine(engine), m_obj(criteria.getRole().getParent()), m_extBlock(NULL), m_current(NULL) +{ + // If we can't hook the metadata for changes, then we can't do any caching and the rest of this is academic. + const ObservableMetadataProvider* observable = dynamic_cast(&pkixSource); + if (!observable) + return; + + // While holding read lock, see if this metadata plugin has been seen before. + m_engine.m_credLock->rdlock(); + m_credCache = m_engine.m_credentialMap.find(observable); + if (m_credCache==m_engine.m_credentialMap.end()) { + + // We need to elevate the lock and retry. + m_engine.m_credLock->unlock(); + m_engine.m_credLock->wrlock(); + m_credCache = m_engine.m_credentialMap.find(observable); + if (m_credCache==m_engine.m_credentialMap.end()) { + + // It's still brand new, so hook it for cache activation. + observable->addObserver(&m_engine); + + // Prime the map reference with an empty credential map. + m_credCache = m_engine.m_credentialMap.insert(make_pair(observable,PKIXTrustEngine::credmap_t())).first; + + // Downgrade the lock. + // We don't have to recheck because we never erase the master map entry entirely, even on changes. + m_engine.m_credLock->unlock(); + m_engine.m_credLock->rdlock(); + } + } + + // We've hooked the metadata for changes, and we know we can cache against it. + m_caching = true; +} + + +bool MetadataPKIXIterator::next() +{ + // If we had an active block, look for another in the same block. + if (m_extBlock) { + // Keep going until we hit the end of the block. + vector::const_iterator end = m_extBlock->getUnknownXMLObjects().end(); + while (m_iter != end) { + // If we hit a KeyAuthority, remember it and signal. + if (m_current=dynamic_cast(*m_iter++)) { + populate(); + return true; + } + } + + // If we get here, we hit the end of this Extensions block. + // Climb a level, if possible. + m_obj = m_obj->getParent(); + m_current = NULL; + m_extBlock = NULL; + } + + // If we get here, we try and find an Extensions block. + while (m_obj) { + const EntityDescriptor* entity = dynamic_cast(m_obj); + if (entity) { + m_extBlock = entity->getExtensions(); + } + else { + const EntitiesDescriptor* entities = dynamic_cast(m_obj); + if (entities) { + m_extBlock = entities->getExtensions(); + } + } + + if (m_extBlock) { + m_iter = m_extBlock->getUnknownXMLObjects().begin(); + return next(); + } + + // Jump a level and try again. + m_obj = m_obj->getParent(); + } + + return false; +} + +void MetadataPKIXIterator::populate() +{ + // Dump anything old. + m_certs.clear(); + m_crls.clear(); + for_each(m_ownedCreds.begin(), m_ownedCreds.end(), xmltooling::cleanup()); + + if (m_caching) { + // We're holding a read lock. Search for "resolved" creds. + PKIXTrustEngine::credmap_t::iterator cached = m_credCache->second.find(m_current); + if (cached!=m_credCache->second.end()) { + // Copy over the information. + for (vector::const_iterator c=cached->second.begin(); c!=cached->second.end(); ++c) { + m_certs.insert(m_certs.end(), (*c)->getEntityCertificateChain().begin(), (*c)->getEntityCertificateChain().end()); + if ((*c)->getCRL()) + m_crls.push_back((*c)->getCRL()); + } + return; + } + } + + // We're either not caching or didn't find the results we need, so we have to resolve them. + const vector& keyInfos = m_current->getKeyInfos(); + for (vector::const_iterator k = keyInfos.begin(); k!=keyInfos.end(); ++k) { + auto_ptr cred (m_engine.getKeyInfoResolver()->resolve(*k, X509Credential::RESOLVE_CERTS | X509Credential::RESOLVE_CRLS)); + X509Credential* xcred = dynamic_cast(cred.get()); + if (xcred) { + m_ownedCreds.push_back(xcred); + cred.release(); + } + } + + // Copy over the new information. + for (vector::const_iterator c=m_ownedCreds.begin(); c!=m_ownedCreds.end(); ++c) { + m_certs.insert(m_certs.end(), (*c)->getEntityCertificateChain().begin(), (*c)->getEntityCertificateChain().end()); + if ((*c)->getCRL()) + m_crls.push_back((*c)->getCRL()); + } + + // As a last step, if we're caching, try and elevate to a write lock for cache insertion. + if (m_caching) { + m_engine.m_credLock->unlock(); + m_engine.m_credLock->wrlock(); + PKIXTrustEngine::credmap_t::iterator cached = m_credCache->second.find(m_current); + if (m_credCache->second.count(m_current)==0) { + // Transfer objects into cache. + m_credCache->second[m_current] = m_ownedCreds; + m_ownedCreds.clear(); + } + m_engine.m_credLock->unlock(); + m_engine.m_credLock->rdlock(); + + // In theory we could have lost the objects but that shouldn't be possible + // since the metadata itself is locked and shouldn't change behind us. + } +} diff --git a/shibsp/security/PKIXTrustEngine.h b/shibsp/security/PKIXTrustEngine.h new file mode 100644 index 0000000..c01f9ac --- /dev/null +++ b/shibsp/security/PKIXTrustEngine.h @@ -0,0 +1,38 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/security/PKIXTrustEngine.h + * + * Shibboleth-specific PKIX-validation TrustEngine + */ + +#ifndef __shibsp_pkixtrust_h__ +#define __shibsp_pkixtrust_h__ + +#include + +namespace shibsp { + /** + * Registers trust engine plugin. + */ + void SHIBSP_API registerPKIXTrustEngine(); + + /** TrustEngine based on Shibboleth PKIX metadata extension. */ + #define SHIBBOLETH_PKIX_TRUSTENGINE "PKIX" +}; + +#endif /* __shibsp_pkixtrust_h__ */ diff --git a/shibsp/security/SecurityPolicy.cpp b/shibsp/security/SecurityPolicy.cpp new file mode 100644 index 0000000..6e260d4 --- /dev/null +++ b/shibsp/security/SecurityPolicy.cpp @@ -0,0 +1,36 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SecurityPolicy.cpp + * + * SP-specific SecurityPolicy subclass. + */ + +#include "internal.h" +#include "Application.h" +#include "ServiceProvider.h" +#include "security/SecurityPolicy.h" + +using namespace shibsp; + +SecurityPolicy::SecurityPolicy(const Application& application, const xmltooling::QName* role, bool validate) + : opensaml::SecurityPolicy(application.getMetadataProvider(), role, application.getTrustEngine(), validate), m_application(application) { + + const std::vector& rules = + application.getServiceProvider().getPolicyRules(application.getString("policyId").second); + getRules().assign(rules.begin(), rules.end()); +} diff --git a/shibsp/security/SecurityPolicy.h b/shibsp/security/SecurityPolicy.h new file mode 100644 index 0000000..74745ff --- /dev/null +++ b/shibsp/security/SecurityPolicy.h @@ -0,0 +1,65 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/security/SecurityPolicy.h + * + * SP-specific SecurityPolicy subclass. + */ + +#ifndef __shibsp_secpol_h__ +#define __shibsp_secpol_h__ + +#include +#include + +namespace shibsp { + + class SHIBSP_API Application; + + /** + * SP-specific SecurityPolicy subclass. + */ + class SHIBSP_API SecurityPolicy : public opensaml::SecurityPolicy + { + public: + /** + * Constructor for policy. + * + * @param application an Application instance + * @param role identifies the role (generally IdP or SP) of the policy peer + * @param validate true iff XML parsing should be done with validation + */ + SecurityPolicy(const Application& application, const xmltooling::QName* role=NULL, bool validate=true); + + virtual ~SecurityPolicy() {} + + /** + * Returns the Application associated with the policy. + * + * @return the associated Application + */ + const Application& getApplication() const { + return m_application; + } + + private: + const Application& m_application; + }; + +}; + +#endif /* __shibsp_secpol_h__ */ diff --git a/shibsp/shibsp-lite.vcproj b/shibsp/shibsp-lite.vcproj new file mode 100644 index 0000000..2a1e205 --- /dev/null +++ b/shibsp/shibsp-lite.vcproj @@ -0,0 +1,572 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shibsp/shibsp.rc b/shibsp/shibsp.rc new file mode 100644 index 0000000..a74a740 --- /dev/null +++ b/shibsp/shibsp.rc @@ -0,0 +1,137 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Internet2\0" +#ifdef SHIBSP_LITE + VALUE "FileDescription", "Shibboleth SP Lite Library\0" +#else + VALUE "FileDescription", "Shibboleth SP Library\0" +#endif + VALUE "FileVersion", "1, 0, 0, 0\0" +#ifdef SHIBSP_LITE +#ifdef _DEBUG + VALUE "InternalName", "shibsp-lite1_0D\0" +#else + VALUE "InternalName", "shibsp-lite1_0\0" +#endif +#else +#ifdef _DEBUG + VALUE "InternalName", "shibsp1_0D\0" +#else + VALUE "InternalName", "shibsp1_0\0" +#endif +#endif + VALUE "LegalCopyright", "Copyright © 2007 Internet2\0" + VALUE "LegalTrademarks", "\0" +#ifdef SHIBSP_LITE +#ifdef _DEBUG + VALUE "OriginalFilename", "shibsp-lite1_0D.dll\0" +#else + VALUE "OriginalFilename", "shibsp-lite1_0.dll\0" +#endif +#else +#ifdef _DEBUG + VALUE "OriginalFilename", "shibsp1_0D.dll\0" +#else + VALUE "OriginalFilename", "shibsp1_0.dll\0" +#endif +#endif + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shibboleth 2.0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/shibsp/shibsp.vcproj b/shibsp/shibsp.vcproj new file mode 100644 index 0000000..c8d78c2 --- /dev/null +++ b/shibsp/shibsp.vcproj @@ -0,0 +1,799 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shibsp/util/CGIParser.cpp b/shibsp/util/CGIParser.cpp new file mode 100644 index 0000000..1011351 --- /dev/null +++ b/shibsp/util/CGIParser.cpp @@ -0,0 +1,124 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * CGIParser.cpp + * + * CGI GET/POST parameter parsing + */ + +#include "internal.h" +#include "util/CGIParser.h" + +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + + +CGIParser::CGIParser(const HTTPRequest& request) +{ + const char* pch=NULL; + if (!strcmp(request.getMethod(),"POST")) + pch=request.getRequestBody(); + else + pch=request.getQueryString(); + size_t cl=pch ? strlen(pch) : 0; + + const URLEncoder* dec = XMLToolingConfig::getConfig().getURLEncoder(); + while (cl && pch) { + char *name; + char *value; + value=fmakeword('&',&cl,&pch); + plustospace(value); + dec->decode(value); + name=makeword(value,'='); + kvp_map.insert(pair(name,value)); + free(name); + } +} + +CGIParser::~CGIParser() +{ + for (multimap::iterator i=kvp_map.begin(); i!=kvp_map.end(); i++) + free(i->second); +} + +pair CGIParser::getParameters(const char* name) const +{ + return kvp_map.equal_range(name); +} + +/* Parsing routines modified from NCSA source. */ +char* CGIParser::makeword(char *line, char stop) +{ + int x = 0,y; + char *word = (char *) malloc(sizeof(char) * (strlen(line) + 1)); + + for(x=0;((line[x]) && (line[x] != stop));x++) + word[x] = line[x]; + + word[x] = '\0'; + if(line[x]) + ++x; + y=0; + + while(line[x]) + line[y++] = line[x++]; + line[y] = '\0'; + return word; +} + +char* CGIParser::fmakeword(char stop, size_t *cl, const char** ppch) +{ + int wsize; + char *word; + int ll; + + wsize = 1024; + ll=0; + word = (char *) malloc(sizeof(char) * (wsize + 1)); + + while(1) + { + word[ll] = *((*ppch)++); + if(ll==wsize-1) + { + word[ll+1] = '\0'; + wsize+=1024; + word = (char *)realloc(word,sizeof(char)*(wsize+1)); + } + --(*cl); + if((word[ll] == stop) || word[ll] == EOF || (!(*cl))) + { + if(word[ll] != stop) + ll++; + word[ll] = '\0'; + return word; + } + ++ll; + } +} + +void CGIParser::plustospace(char *str) +{ + register int x; + + for(x=0;str[x];x++) + if(str[x] == '+') str[x] = ' '; +} diff --git a/shibsp/util/CGIParser.h b/shibsp/util/CGIParser.h new file mode 100644 index 0000000..b76953d --- /dev/null +++ b/shibsp/util/CGIParser.h @@ -0,0 +1,77 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/util/CGIParser.h + * + * CGI GET/POST parameter parsing + */ + +#ifndef __shibsp_cgi_h__ +#define __shibsp_cgi_h__ + +#include +#include + +namespace shibsp { + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + + /** + * CGI GET/POST parameter parsing + */ + class SHIBSP_API CGIParser + { + MAKE_NONCOPYABLE(CGIParser); + public: + /** + * Constructor + * + * @param request HTTP request interface + */ + CGIParser(const xmltooling::HTTPRequest& request); + + ~CGIParser(); + + /** Alias for multimap iterator. */ + typedef std::multimap::const_iterator walker; + + /** + * Returns a pair of bounded iterators around the values of a parameter. + * + * @param name name of parameter + * @return a pair of multimap iterators surrounding the matching value(s) + */ + std::pair getParameters(const char* name) const; + + private: + char* fmakeword(char stop, size_t *cl, const char** ppch); + char* makeword(char *line, char stop); + void plustospace(char *str); + + std::multimap kvp_map; + }; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +}; + +#endif /* __shibsp_cgi_h__ */ diff --git a/shibsp/util/DOMPropertySet.cpp b/shibsp/util/DOMPropertySet.cpp new file mode 100644 index 0000000..f2cb41a --- /dev/null +++ b/shibsp/util/DOMPropertySet.cpp @@ -0,0 +1,230 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * DOMPropertySet.cpp + * + * DOM-based property set implementation. + */ + +#include "internal.h" +#include "util/DOMPropertySet.h" + +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +DOMPropertySet::~DOMPropertySet() +{ + for (map >::iterator i=m_map.begin(); i!=m_map.end(); i++) + XMLString::release(&(i->second.first)); + for_each(m_nested.begin(),m_nested.end(),cleanup_pair()); +} + +void DOMPropertySet::load( + const DOMElement* e, + Category* log, + DOMNodeFilter* filter, + const std::map* remapper + ) +{ +#ifdef _DEBUG + NDC ndc("load"); +#endif + if (!e) + return; + m_root=e; + if (!log) + log = &Category::getInstance(SHIBSP_LOGCAT".PropertySet"); + + // Process each attribute as a property. + DOMNamedNodeMap* attrs=m_root->getAttributes(); + for (XMLSize_t i=0; igetLength(); i++) { + DOMNode* a=attrs->item(i); + if (!XMLString::compareString(a->getNamespaceURI(),xmlconstants::XMLNS_NS)) + continue; + char* val=XMLString::transcode(a->getNodeValue()); + if (val && *val) { + auto_ptr_char ns(a->getNamespaceURI()); + auto_ptr_char name(a->getLocalName()); + const char* realname=name.get(); + map::const_iterator remap; + if (remapper) { + remap=remapper->find(realname); + if (remap!=remapper->end()) { + log->warn("remapping property (%s) to (%s)",realname,remap->second.c_str()); + realname=remap->second.c_str(); + } + } + if (ns.get()) { + if (remapper && (remap=remapper->find(ns.get()))!=remapper->end()) + m_map[string("{") + remap->second.c_str() + '}' + realname]=pair(val,a->getNodeValue()); + else + m_map[string("{") + ns.get() + '}' + realname]=pair(val,a->getNodeValue()); + log->debug("added property {%s}%s (%s)",ns.get(),realname,val); + } + else { + m_map[realname]=pair(val,a->getNodeValue()); + log->debug("added property %s (%s)",realname,val); + } + } + } + + // Process non-excluded elements as nested sets. + DOMTreeWalker* walker= + static_cast( + m_root->getOwnerDocument())->createTreeWalker(const_cast(m_root),DOMNodeFilter::SHOW_ELEMENT,filter,false + ); + e=static_cast(walker->firstChild()); + while (e) { + auto_ptr_char ns(e->getNamespaceURI()); + auto_ptr_char name(e->getLocalName()); + const char* realname=name.get(); + map::const_iterator remap; + if (remapper) { + remap=remapper->find(realname); + if (remap!=remapper->end()) { + log->warn("remapping property set (%s) to (%s)",realname,remap->second.c_str()); + realname=remap->second.c_str(); + } + } + string key; + if (ns.get()) { + if (remapper && (remap=remapper->find(ns.get()))!=remapper->end()) + key=string("{") + remap->second.c_str() + '}' + realname; + else + key=string("{") + ns.get() + '}' + realname; + } + else + key=realname; + if (m_nested.find(key)!=m_nested.end()) + log->warn("load() skipping duplicate property set: %s",key.c_str()); + else { + DOMPropertySet* set=new DOMPropertySet(); + set->load(e,log,filter,remapper); + m_nested[key]=set; + log->debug("added nested property set: %s",key.c_str()); + } + e=static_cast(walker->nextSibling()); + } + walker->release(); +} + +pair DOMPropertySet::getBool(const char* name, const char* ns) const +{ + map >::const_iterator i; + + if (ns) + i=m_map.find(string("{") + ns + '}' + name); + else + i=m_map.find(name); + + if (i!=m_map.end()) + return make_pair(true,(!strcmp(i->second.first,"true") || !strcmp(i->second.first,"1"))); + else if (m_parent) + return m_parent->getBool(name,ns); + return make_pair(false,false); +} + +pair DOMPropertySet::getString(const char* name, const char* ns) const +{ + pair ret(false,NULL); + map >::const_iterator i; + + if (ns) + i=m_map.find(string("{") + ns + '}' + name); + else + i=m_map.find(name); + + if (i!=m_map.end()) + return pair(true,i->second.first); + else if (m_parent) + return m_parent->getString(name,ns); + return pair(false,NULL); +} + +pair DOMPropertySet::getXMLString(const char* name, const char* ns) const +{ + map >::const_iterator i; + + if (ns) + i=m_map.find(string("{") + ns + '}' + name); + else + i=m_map.find(name); + + if (i!=m_map.end()) + return make_pair(true,i->second.second); + else if (m_parent) + return m_parent->getXMLString(name,ns); + return pair(false,NULL); +} + +pair DOMPropertySet::getUnsignedInt(const char* name, const char* ns) const +{ + map >::const_iterator i; + + if (ns) + i=m_map.find(string("{") + ns + '}' + name); + else + i=m_map.find(name); + + if (i!=m_map.end()) + return pair(true,strtol(i->second.first,NULL,10)); + else if (m_parent) + return m_parent->getUnsignedInt(name,ns); + return pair(false,0); +} + +pair DOMPropertySet::getInt(const char* name, const char* ns) const +{ + map >::const_iterator i; + + if (ns) + i=m_map.find(string("{") + ns + '}' + name); + else + i=m_map.find(name); + + if (i!=m_map.end()) + return pair(true,atoi(i->second.first)); + else if (m_parent) + return m_parent->getInt(name,ns); + return pair(false,0); +} + +void DOMPropertySet::getAll(std::map& properties) const +{ + if (m_parent) + m_parent->getAll(properties); + for (map< string,pair >::const_iterator i = m_map.begin(); i != m_map.end(); ++i) + properties[i->first] = i->second.first; +} + +const PropertySet* DOMPropertySet::getPropertySet(const char* name, const char* ns) const +{ + map::const_iterator i; + + if (ns) + i=m_nested.find(string("{") + ns + '}' + name); + else + i=m_nested.find(name); + + return (i!=m_nested.end()) ? i->second : (m_parent ? m_parent->getPropertySet(name,ns) : NULL); +} diff --git a/shibsp/util/DOMPropertySet.h b/shibsp/util/DOMPropertySet.h new file mode 100644 index 0000000..d642615 --- /dev/null +++ b/shibsp/util/DOMPropertySet.h @@ -0,0 +1,85 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/util/DOMPropertySet.h + * + * DOM-based property set implementation. + */ + +#ifndef __shibsp_dompropset_h__ +#define __shibsp_dompropset_h__ + +#include +#include + +namespace shibsp { + + /** + * DOM-based property set implementation. + */ + class SHIBSP_API DOMPropertySet : public virtual PropertySet + { + public: + DOMPropertySet() : m_parent(NULL), m_root(NULL) {} + + virtual ~DOMPropertySet(); + + const PropertySet* getParent() const { + return m_parent; + } + + void setParent(const PropertySet* parent) { + m_parent = parent; + } + + std::pair getBool(const char* name, const char* ns=NULL) const; + std::pair getString(const char* name, const char* ns=NULL) const; + std::pair getXMLString(const char* name, const char* ns=NULL) const; + std::pair getUnsignedInt(const char* name, const char* ns=NULL) const; + std::pair getInt(const char* name, const char* ns=NULL) const; + void getAll(std::map& properties) const; + const PropertySet* getPropertySet(const char* name, const char* ns=shibspconstants::ASCII_SHIB2SPCONFIG_NS) const; + + const xercesc::DOMElement* getElement() const { + return m_root; + } + + /** + * Loads the property set from a DOM element. + * + * @param e root element of property set + * @param log optional log object for tracing + * @param filter optional filter controls what child elements to include as nested PropertySets + * @param remapper optional map of property rename rules for legacy property support + */ + void load( + const xercesc::DOMElement* e, + xmltooling::logging::Category* log=NULL, + xercesc::DOMNodeFilter* filter=NULL, + const std::map* remapper=NULL + ); + + private: + const PropertySet* m_parent; + const xercesc::DOMElement* m_root; + std::map > m_map; + std::map m_nested; + }; + +}; + +#endif /* __shibsp_dompropset_h__ */ diff --git a/shibsp/util/PropertySet.h b/shibsp/util/PropertySet.h new file mode 100644 index 0000000..bfc7988 --- /dev/null +++ b/shibsp/util/PropertySet.h @@ -0,0 +1,127 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/util/PropertySet.h + * + * Interface to a generic set of typed properties or a DOM container of additional data. + */ + +#ifndef __shibsp_propset_h__ +#define __shibsp_propset_h__ + +#include +#include +#include + +namespace shibsp { + + /** + * Interface to a generic set of typed properties or a DOM container of additional data. + */ + class SHIBSP_API PropertySet + { + MAKE_NONCOPYABLE(PropertySet); + protected: + PropertySet() {} + public: + virtual ~PropertySet() {} + + /** + * Returns parent of this PropertySet, if any. + * + * @return the parent object, or NULL + */ + virtual const PropertySet* getParent() const=0; + + /** + * Establishes a "parent" PropertySet to supply inherited settings. + * + * @param parent the parent PropertySet to use + */ + virtual void setParent(const PropertySet* parent)=0; + + /** + * Returns a boolean-valued property. + * + * @param name property name + * @param ns property namespace, or NULL + * @return a pair consisting of a NULL indicator and the property value iff the indicator is true + */ + virtual std::pair getBool(const char* name, const char* ns=NULL) const=0; + + /** + * Returns a string-valued property. + * + * @param name property name + * @param ns property namespace, or NULL + * @return a pair consisting of a NULL indicator and the property value iff the indicator is true + */ + virtual std::pair getString(const char* name, const char* ns=NULL) const=0; + + /** + * Returns a Unicode string-valued property. + * + * @param name property name + * @param ns property namespace, or NULL + * @return a pair consisting of a NULL indicator and the property value iff the indicator is true + */ + virtual std::pair getXMLString(const char* name, const char* ns=NULL) const=0; + + /** + * Returns an unsigned integer-valued property. + * + * @param name property name + * @param ns property namespace, or NULL + * @return a pair consisting of a NULL indicator and the property value iff the indicator is true + */ + virtual std::pair getUnsignedInt(const char* name, const char* ns=NULL) const=0; + + /** + * Returns an integer-valued property. + * + * @param name property name + * @param ns property namespace, or NULL + * @return a pair consisting of a NULL indicator and the property value iff the indicator is true + */ + virtual std::pair getInt(const char* name, const char* ns=NULL) const=0; + + /** + * Returns a map of all known properties in string form. + * + * @param properties map to populate + */ + virtual void getAll(std::map& properties) const=0; + + /** + * Returns a nested property set. + * + * @param name nested property set name + * @param ns nested property set namespace, or NULL + * @return the nested property set, or NULL + */ + virtual const PropertySet* getPropertySet(const char* name, const char* ns=shibspconstants::ASCII_SHIB2SPCONFIG_NS) const=0; + + /** + * Returns a DOM element representing the property container, if any. + * + * @return a DOM element, or NULL + */ + virtual const xercesc::DOMElement* getElement() const=0; + }; +}; + +#endif /* __shibsp_propset_h__ */ diff --git a/shibsp/util/SPConstants.cpp b/shibsp/util/SPConstants.cpp new file mode 100644 index 0000000..38f0a0a --- /dev/null +++ b/shibsp/util/SPConstants.cpp @@ -0,0 +1,116 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SPConstants.cpp + * + * SP XML namespace constants + */ + +#include "internal.h" +#include "util/SPConstants.h" +#include + +using namespace shibspconstants; + +const XMLCh shibspconstants::SHIB1_PROTOCOL_ENUM[] = // urn:mace:shibboleth:1.0 +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_1, chPeriod, chDigit_0, chNull +}; + +const XMLCh shibspconstants::SHIBMD_NS[] = // urn:mace:shibboleth:metadata:1.0 +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chColon, + chDigit_1, chPeriod, chDigit_0, chNull +}; + +const XMLCh shibspconstants::SHIBMD_PREFIX[] = UNICODE_LITERAL_6(s,h,i,b,m,d); + +const XMLCh shibspconstants::SHIB2SPCONFIG_NS[] = // urn:mace:shibboleth:2.0:native:sp:config +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_2, chPeriod, chDigit_0, chColon, chLatin_n, chLatin_a, chLatin_t, chLatin_i, chLatin_v, chLatin_e, chColon, + chLatin_s, chLatin_p, chColon, chLatin_c, chLatin_o, chLatin_n, chLatin_f, chLatin_i, chLatin_g, chNull +}; + +const XMLCh shibspconstants::SHIB2ATTRIBUTEMAP_NS[] = // urn:mace:shibboleth:2.0:attribute-map +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chDash, + chLatin_m, chLatin_a, chLatin_p, chNull +}; + +const XMLCh shibspconstants::SHIB2SPNOTIFY_NS[] = // urn:mace:shibboleth:2.0:sp:notify +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_2, chPeriod, chDigit_0, chColon, chLatin_s, chLatin_p, chColon, + chLatin_n, chLatin_o, chLatin_t, chLatin_i, chLatin_f, chLatin_y, chNull +}; + +const XMLCh shibspconstants::SHIB2ATTRIBUTEFILTER_NS[] = // urn:mace:shibboleth:2.0:afp +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_2, chPeriod, chDigit_0, chColon, chLatin_a, chLatin_f, chLatin_p, chNull +}; + +const XMLCh shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS[] = // urn:mace:shibboleth:2.0:afp:mf:basic +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_2, chPeriod, chDigit_0, chColon, chLatin_a, chLatin_f, chLatin_p, chColon, chLatin_m, chLatin_f, chColon, + chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull +}; + +const XMLCh shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS[] = // urn:mace:shibboleth:2.0:afp:mf:saml +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_2, chPeriod, chDigit_0, chColon, chLatin_a, chLatin_f, chLatin_p, chColon, chLatin_m, chLatin_f, chColon, + chLatin_s, chLatin_a, chLatin_m, chLatin_l, chNull +}; + +const XMLCh shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI[] = // urn:mace:shibboleth:1.0:attributeNamespace:uri +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, + chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_u, chLatin_r, chLatin_i, chNull +}; + +const XMLCh shibspconstants::SHIB1_NAMEID_FORMAT_URI[] = // urn:mace:shibboleth:1.0:nameIdentifier +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, + chLatin_I, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_r, chNull +}; + +const XMLCh shibspconstants::SHIB1_AUTHNREQUEST_PROFILE_URI[] = // urn:mace:shibboleth:1.0:profiles:AuthnRequest +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon, + chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chColon, + chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_n, + chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chNull +}; + +const char shibspconstants::SHIB1_SESSIONINIT_PROFILE_URI[] = "urn:mace:shibboleth:sp:1.3:SessionInit"; + +const char shibspconstants::SHIB1_LOGOUT_PROFILE_URI[] = "urn:mace:shibboleth:sp:1.3:Logout"; + +const char shibspconstants::ASCII_SHIB2SPCONFIG_NS[] = "urn:mace:shibboleth:2.0:native:sp:config"; diff --git a/shibsp/util/SPConstants.h b/shibsp/util/SPConstants.h new file mode 100644 index 0000000..dd730f9 --- /dev/null +++ b/shibsp/util/SPConstants.h @@ -0,0 +1,84 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/util/SPConstants.h + * + * Shibboleth SP XML constants. + */ + +#ifndef __shibsp_constants_h__ +#define __shibsp_constants_h__ + +#include +#ifndef SHIBSP_LITE +# include +#else +# include +#endif + +/** + * Shibboleth SP XML constants. + */ +namespace shibspconstants { + + /** Shibboleth Metadata XML namespace ("urn:mace:shibboleth:metadata:1.0") */ + extern SHIBSP_API const XMLCh SHIBMD_NS[]; + + /** Shibboleth Metadata QName prefix ("shibmd") */ + extern SHIBSP_API const XMLCh SHIBMD_PREFIX[]; + + /** Shibboleth 2.0 SP configuration namespace ("urn:mace:shibboleth:2.0:native:sp:config") */ + extern SHIBSP_API const XMLCh SHIB2SPCONFIG_NS[]; + + /** Shibboleth 2.0 attribute mapping namespace ("urn:mace:shibboleth:2.0:attribute-map") */ + extern SHIBSP_API const XMLCh SHIB2ATTRIBUTEMAP_NS[]; + + /** Shibboleth 2.0 notification namespace ("urn:mace:shibboleth:2.0:sp:notify") */ + extern SHIBSP_API const XMLCh SHIB2SPNOTIFY_NS[]; + + /** Shibboleth 2.0 attribute filter policy namespace ("urn:mace:shibboleth:2.0:afp") */ + extern SHIBSP_API const XMLCh SHIB2ATTRIBUTEFILTER_NS[]; + + /** Shibboleth 2.0 basic matching function namespace ("urn:mace:shibboleth:2.0:afp:mf:basic") */ + extern SHIBSP_API const XMLCh SHIB2ATTRIBUTEFILTER_MF_BASIC_NS[]; + + /** Shibboleth 2.0 SAML matching function namespace ("urn:mace:shibboleth:2.0:afp:mf:saml") */ + extern SHIBSP_API const XMLCh SHIB2ATTRIBUTEFILTER_MF_SAML_NS[]; + + /** Shibboleth 1.x Protocol Enumeration constant ("urn:mace:shibboleth:1.0") */ + extern SHIBSP_API const XMLCh SHIB1_PROTOCOL_ENUM[]; + + /** Shibboleth 1.x URI AttributeNamespace constant ("urn:mace:shibboleth:1.0:attributeNamespace:uri") */ + extern SHIBSP_API const XMLCh SHIB1_ATTRIBUTE_NAMESPACE_URI[]; + + /** Shibboleth 1.x transient NameIdentifier Format constant ("urn:mace:shibboleth:1.0:nameIdentifier") */ + extern SHIBSP_API const XMLCh SHIB1_NAMEID_FORMAT_URI[]; + + /** Shibboleth 1.x AuthnRequest binding/profile ("urn:mace:shibboleth:1.0:profiles:AuthnRequest") */ + extern SHIBSP_API const XMLCh SHIB1_AUTHNREQUEST_PROFILE_URI[]; + + /** Shibboleth 1.3 SessionInit binding/profile ("urn:mace:shibboleth:sp:1.3:SessionInit") */ + extern SHIBSP_API const char SHIB1_SESSIONINIT_PROFILE_URI[]; + + /** Shibboleth 1.3 Local Logout binding/profile ("urn:mace:shibboleth:sp:1.3:Logout") */ + extern SHIBSP_API const char SHIB1_LOGOUT_PROFILE_URI[]; + + /** Shibboleth 2.0 SP configuration namespace ("urn:mace:shibboleth:2.0:native:sp:config") */ + extern SHIBSP_API const char ASCII_SHIB2SPCONFIG_NS[]; +}; + +#endif /* __shibsp_constants_h__ */ diff --git a/shibsp/util/TemplateParameters.cpp b/shibsp/util/TemplateParameters.cpp new file mode 100644 index 0000000..f83abd2 --- /dev/null +++ b/shibsp/util/TemplateParameters.cpp @@ -0,0 +1,85 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TemplateParameters.cpp + * + * Supplies xmltooling TemplateEngine with additional parameters from a PropertySet. + */ + +#include "internal.h" +#include "util/TemplateParameters.h" + +#include +#include +#include + +using namespace shibsp; +using namespace xmltooling; +using namespace std; + +void TemplateParameters::setPropertySet(const PropertySet* props) +{ + m_props = props; + + // Create a timestamp. + time_t now = time(NULL); +#if defined(HAVE_CTIME_R_2) + char timebuf[32]; + m_map["now"] = ctime_r(&now,timebuf); +#elif defined(HAVE_CTIME_R_3) + char timebuf[32]; + m_map["now"] = ctime_r(&now,timebuf,sizeof(timebuf)); +#else + m_map["now"] = ctime(&now); +#endif +} + +const char* TemplateParameters::getParameter(const char* name) const +{ + if (m_exception) { + if (!strcmp(name, "errorType")) + return m_toolingException ? m_toolingException->getClassName() : "std::exception"; + else if (!strcmp(name, "errorText")) + return m_exception->what(); + } + + const char* pch = TemplateEngine::TemplateParameters::getParameter(name); + if (pch || !m_props) + return pch; + pair p = m_props->getString(name); + return p.first ? p.second : NULL; +} + +string TemplateParameters::toQueryString() const +{ + // Capture local stuff. + string q; + + const URLEncoder* enc = XMLToolingConfig::getConfig().getURLEncoder(); + for (map::const_iterator i=m_map.begin(); i!=m_map.end(); i++) + q = q + '&' + i->first + '=' + enc->encode(i->second.c_str()); + + // Add in the exception content. + if (m_exception) { + q = q + "&errorType=" + enc->encode(getParameter("errorType")) + "&errorText=" + enc->encode(getParameter("errorText")); + if (m_toolingException) + q = q + '&' + m_toolingException->toQueryString(); + } + + q.erase(0,1); + return q; +} diff --git a/shibsp/util/TemplateParameters.h b/shibsp/util/TemplateParameters.h new file mode 100644 index 0000000..f04f42a --- /dev/null +++ b/shibsp/util/TemplateParameters.h @@ -0,0 +1,84 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file shibsp/util/TemplateParameters.h + * + * Supplies xmltooling TemplateEngine with additional parameters from a PropertySet. + */ + +#ifndef __shibsp_tempparams_h__ +#define __shibsp_tempparams_h__ + +#include +#include + +namespace shibsp { + + /** + * Supplies xmltooling TemplateEngine with additional parameters from a PropertySet. + */ + class SHIBSP_API TemplateParameters : public xmltooling::TemplateEngine::TemplateParameters + { + public: + /** + * Constructor + * + * @param e an exception to supply additional parameters + * @param props a PropertySet to supply additional parameters + */ + TemplateParameters(const std::exception* e=NULL, const PropertySet* props=NULL) + : m_exception(e), m_toolingException(dynamic_cast(e)) { + setPropertySet(props); + } + + virtual ~TemplateParameters() {} + + /** + * Sets a PropertySet to supply additional parameters. + * + * @param props a PropertySet to supply additional parameters + */ + void setPropertySet(const PropertySet* props); + + /** + * Returns the exception passed to the object, if it contains rich information. + * + * @return an exception, or NULL + */ + const xmltooling::XMLToolingException* getRichException() const { + return m_toolingException; + } + + const char* getParameter(const char* name) const; + + /** + * Returns a set of query string name/value pairs, URL-encoded, + * representing all known parameters. If an exception is + * present, it's type, message, and parameters will be included. + * + * @return the query string representation + */ + std::string toQueryString() const; + + private: + const PropertySet* m_props; + const std::exception* m_exception; + const xmltooling::XMLToolingException* m_toolingException; + }; +}; + +#endif /* __shibsp_tempparams_h__ */ diff --git a/shibsp/version.h b/shibsp/version.h new file mode 100644 index 0000000..17ab6e3 --- /dev/null +++ b/shibsp/version.h @@ -0,0 +1,74 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * version.h + * + * Library version macros and constants + */ + +#ifndef __shibsp_version_h__ +#define __shibsp_version_h__ + +// This is all based on Xerces, on the theory it might be useful to +// support this kind of stuff in the future. If they ever yank some +// of this stuff, it can be copied into here. + +#include + +// --------------------------------------------------------------------------- +// V E R S I O N S P E C I F I C A T I O N + +/** + * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH OPENSAML VERSION + * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE + */ + +#define SHIBSP_VERSION_MAJOR 1 +#define SHIBSP_VERSION_MINOR 0 +#define SHIBSP_VERSION_REVISION 0 + +/** DO NOT MODIFY BELOW THIS LINE */ + +/** + * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING: + * + * gShibSPVersionStr, gShibSPFullVersionStr, gShibSPMajVersion, gShibSPMinVersion, gShibSPRevision + */ + +// --------------------------------------------------------------------------- +// V E R S I O N I N F O R M A T I O N + +// ShibSP version strings; these particular macros cannot be used for +// conditional compilation as they are not numeric constants + +#define SHIBSP_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION) +#define SHIBSP_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION) +#define SHIBSP_FULLVERSIONNUM INVK_CAT3_SEP_NIL(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION) +#define SHIBSP_VERSIONSTR INVK_CAT2_SEP_UNDERSCORE(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR) + +const char* const gShibSPVersionStr = SHIBSP_VERSIONSTR; +const char* const gShibSPFullVersionStr = SHIBSP_FULLVERSIONSTR; +const unsigned int gShibSPMajVersion = SHIBSP_VERSION_MAJOR; +const unsigned int gShibSPMinVersion = SHIBSP_VERSION_MINOR; +const unsigned int gShibSPRevision = SHIBSP_VERSION_REVISION; + +// ShibSP version numeric constants that can be used for conditional +// compilation purposes. + +#define _SHIBSP_VERSION CALC_EXPANDED_FORM (SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION) + +#endif /* __shibsp_version_h__ */ diff --git a/util/Makefile.am b/util/Makefile.am new file mode 100644 index 0000000..92e5dca --- /dev/null +++ b/util/Makefile.am @@ -0,0 +1,19 @@ +AUTOMAKE_OPTIONS = foreign + +bin_PROGRAMS = mdquery resolvertest + +resolvertest_SOURCES = resolvertest.cpp + +resolvertest_LDADD = \ + $(top_builddir)/shibsp/libshibsp.la + +resolvertest_LDFLAGS = $(XMLSEC_LIBS) + +mdquery_SOURCES = mdquery.cpp + +mdquery_LDADD = \ + $(top_builddir)/shibsp/libshibsp.la + +mdquery_LDFLAGS = $(XMLSEC_LIBS) + +EXTRA_DIST = mdquery.vcproj resolvertest.vcproj diff --git a/util/Makefile.in b/util/Makefile.in new file mode 100644 index 0000000..f672466 --- /dev/null +++ b/util/Makefile.in @@ -0,0 +1,558 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = mdquery$(EXEEXT) resolvertest$(EXEEXT) +subdir = util +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/doxygen.m4 \ + $(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_mdquery_OBJECTS = mdquery.$(OBJEXT) +mdquery_OBJECTS = $(am_mdquery_OBJECTS) +mdquery_DEPENDENCIES = $(top_builddir)/shibsp/libshibsp.la +am_resolvertest_OBJECTS = resolvertest.$(OBJEXT) +resolvertest_OBJECTS = $(am_resolvertest_OBJECTS) +resolvertest_DEPENDENCIES = $(top_builddir)/shibsp/libshibsp.la +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(mdquery_SOURCES) $(resolvertest_SOURCES) +DIST_SOURCES = $(mdquery_SOURCES) $(resolvertest_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APR1_CONFIG = @APR1_CONFIG@ +APR_CONFIG = @APR_CONFIG@ +APXS = @APXS@ +APXS2 = @APXS2@ +APXS22 = @APXS22@ +APXS22_CFLAGS = @APXS22_CFLAGS@ +APXS22_INCLUDE = @APXS22_INCLUDE@ +APXS2_CFLAGS = @APXS2_CFLAGS@ +APXS2_INCLUDE = @APXS2_INCLUDE@ +APXS_CFLAGS = @APXS_CFLAGS@ +APXS_INCLUDE = @APXS_INCLUDE@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_AP13_FALSE = @BUILD_AP13_FALSE@ +BUILD_AP13_TRUE = @BUILD_AP13_TRUE@ +BUILD_AP20_FALSE = @BUILD_AP20_FALSE@ +BUILD_AP20_TRUE = @BUILD_AP20_TRUE@ +BUILD_AP22_FALSE = @BUILD_AP22_FALSE@ +BUILD_AP22_TRUE = @BUILD_AP22_TRUE@ +BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@ +BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@ +BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@ +BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@ +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@ +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@ +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@ +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@ +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@ +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@ +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@ +DX_COND_html_FALSE = @DX_COND_html_FALSE@ +DX_COND_html_TRUE = @DX_COND_html_TRUE@ +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@ +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@ +DX_COND_man_FALSE = @DX_COND_man_FALSE@ +DX_COND_man_TRUE = @DX_COND_man_TRUE@ +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@ +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@ +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@ +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@ +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@ +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@ +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@ +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FASTCGI_INCLUDE = @FASTCGI_INCLUDE@ +FASTCGI_LDFLAGS = @FASTCGI_LDFLAGS@ +FASTCGI_LIBS = @FASTCGI_LIBS@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LITE_LIBS = @LITE_LIBS@ +LN_S = @LN_S@ +LOG4CPP_CONFIG = @LOG4CPP_CONFIG@ +LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NSAPI_INCLUDE = @NSAPI_INCLUDE@ +OBJEXT = @OBJEXT@ +ODBC_CFLAGS = @ODBC_CFLAGS@ +ODBC_CONFIG = @ODBC_CONFIG@ +ODBC_LIBS = @ODBC_LIBS@ +OPENSAMLXMLDIR = @OPENSAMLXMLDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WANT_SUBDIRS = @WANT_SUBDIRS@ +XMLSEC_LIBS = @XMLSEC_LIBS@ +XMLTOOLINGXMLDIR = @XMLTOOLINGXMLDIR@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_DX_DOT = @ac_pt_DX_DOT@ +ac_pt_DX_DOXYGEN = @ac_pt_DX_DOXYGEN@ +ac_pt_DX_DVIPS = @ac_pt_DX_DVIPS@ +ac_pt_DX_EGREP = @ac_pt_DX_EGREP@ +ac_pt_DX_HHC = @ac_pt_DX_HHC@ +ac_pt_DX_LATEX = @ac_pt_DX_LATEX@ +ac_pt_DX_MAKEINDEX = @ac_pt_DX_MAKEINDEX@ +ac_pt_DX_PDFLATEX = @ac_pt_DX_PDFLATEX@ +ac_pt_DX_PERL = @ac_pt_DX_PERL@ +acx_pthread_config = @acx_pthread_config@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xs = @xs@ +AUTOMAKE_OPTIONS = foreign +resolvertest_SOURCES = resolvertest.cpp +resolvertest_LDADD = \ + $(top_builddir)/shibsp/libshibsp.la + +resolvertest_LDFLAGS = $(XMLSEC_LIBS) +mdquery_SOURCES = mdquery.cpp +mdquery_LDADD = \ + $(top_builddir)/shibsp/libshibsp.la + +mdquery_LDFLAGS = $(XMLSEC_LIBS) +EXTRA_DIST = mdquery.vcproj resolvertest.vcproj +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign util/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +mdquery$(EXEEXT): $(mdquery_OBJECTS) $(mdquery_DEPENDENCIES) + @rm -f mdquery$(EXEEXT) + $(CXXLINK) $(mdquery_LDFLAGS) $(mdquery_OBJECTS) $(mdquery_LDADD) $(LIBS) +resolvertest$(EXEEXT): $(resolvertest_OBJECTS) $(resolvertest_DEPENDENCIES) + @rm -f resolvertest$(EXEEXT) + $(CXXLINK) $(resolvertest_LDFLAGS) $(resolvertest_OBJECTS) $(resolvertest_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mdquery.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolvertest.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/util/mdquery.cpp b/util/mdquery.cpp new file mode 100644 index 0000000..00e1e49 --- /dev/null +++ b/util/mdquery.cpp @@ -0,0 +1,182 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * mdquery.cpp + * + * SAML Metadata Query tool layered on SP configuration + */ + +#if defined (_MSC_VER) || defined(__BORLANDC__) +# include "config_win32.h" +#else +# include "config.h" +#endif + +#ifdef WIN32 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling::logging; +using namespace xmltooling; +using namespace std; + +void usage() +{ + cerr << "usage: mdquery -e [-a -nostrict]" << endl; + cerr << " mdquery -e -r -p [-a -ns -nostrict]" << endl; +} + +int main(int argc,char* argv[]) +{ + char* entityID = NULL; + char* appID = "default"; + bool strict = true; + char* prot = NULL; + const XMLCh* protocol = NULL; + char* rname = NULL; + char* rns = NULL; + + for (int i=1; i docjanitor(dummydoc); + xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,_path); + auto_ptr_XMLCh src(config); + dummy->setAttributeNS(NULL,_path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + conf.setServiceProvider(conf.ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + conf.getServiceProvider()->init(); + } + catch (exception&) { + conf.term(); + return -2; + } + + ServiceProvider* sp=conf.getServiceProvider(); + sp->lock(); + + Category& log = Category::getInstance(SHIBSP_LOGCAT".Utility.MDQuery"); + + const Application* app = sp->getApplication(appID); + if (!app) { + log.error("unknown application ID (%s)", appID); + sp->unlock(); + conf.term(); + return -3; + } + + app->getMetadataProvider()->lock(); + MetadataProvider::Criteria mc(entityID, NULL, NULL, strict); + if (rname) { + const XMLCh* ns = rns ? XMLString::transcode(rns) : samlconstants::SAML20MD_NS; + auto_ptr_XMLCh n(rname); + QName q(ns, n.get()); + mc.role = &q; + mc.protocol = protocol; + const RoleDescriptor* role = app->getMetadataProvider()->getEntityDescriptor(mc).second; + if (role) + XMLHelper::serialize(role->marshall(), cout, true); + else + log.error("compatible role %s not found for (%s)", q.toString().c_str(), entityID); + } + else { + const EntityDescriptor* entity = app->getMetadataProvider()->getEntityDescriptor(mc).first; + if (entity) + XMLHelper::serialize(entity->marshall(), cout, true); + else + log.error("no metadata found for (%s)", entityID); + } + + app->getMetadataProvider()->unlock(); + + sp->unlock(); + conf.term(); + return 0; +} diff --git a/util/mdquery.vcproj b/util/mdquery.vcproj new file mode 100644 index 0000000..5992811 --- /dev/null +++ b/util/mdquery.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/util/resolvertest.cpp b/util/resolvertest.cpp new file mode 100644 index 0000000..6e589f7 --- /dev/null +++ b/util/resolvertest.cpp @@ -0,0 +1,329 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * resolvertest.cpp + * + * Tool to exercise SP attribute subsystems. + */ + +#if defined (_MSC_VER) || defined(__BORLANDC__) +# include "config_win32.h" +#else +# include "config.h" +#endif + +#ifdef WIN32 +# define _CRT_NONSTDC_NO_DEPRECATE 1 +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace shibsp; +using namespace opensaml::saml2md; +using namespace opensaml; +using namespace xmltooling::logging; +using namespace xmltooling; +using namespace xercesc; +using namespace std; + +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4250 ) +#endif + +class ResolverTest : public shibsp::AssertionConsumerService +{ +public: + ResolverTest(const DOMElement* e, const char* appId) + : shibsp::AssertionConsumerService(e, appId, Category::getInstance(SHIBSP_LOGCAT".Utilities.ResolverTest")) { + } + virtual ~ResolverTest() {} + + ResolutionContext* resolveAttributes ( + const Application& application, + const RoleDescriptor* issuer, + const XMLCh* protocol, + const saml1::NameIdentifier* v1nameid, + const saml2::NameID* nameid, + const XMLCh* authncontext_class, + const XMLCh* authncontext_decl, + const vector* tokens + ) const { + return shibsp::AssertionConsumerService::resolveAttributes( + application, issuer, protocol, v1nameid, nameid, authncontext_class, authncontext_decl, tokens + ); + } + +private: + void implementProtocol( + const Application& application, + const HTTPRequest& httpRequest, + HTTPResponse& httpResponse, + SecurityPolicy& policy, + const PropertySet* settings, + const XMLObject& xmlObject + ) const { + throw FatalProfileException("Should never be called."); + } +}; + +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif + +void usage() +{ + cerr << "usage: resolvertest -n -i -p [-f -a ]" << endl; + cerr << " resolvertest [-a ] < assertion.xml" << endl; +} + +int main(int argc,char* argv[]) +{ + char* a_param=NULL; + char* n_param=NULL; + char* f_param=NULL; + char* i_param=NULL; + char* prot = NULL; + const XMLCh* protocol = NULL; + char* path=NULL; + char* config=NULL; + + for (int i=1; i docjanitor(dummydoc); + xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path); + auto_ptr_XMLCh src(config); + dummy->setAttributeNS(NULL,path,src.get()); + dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); + + conf.setServiceProvider(conf.ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy)); + conf.getServiceProvider()->init(); + } + catch (exception&) { + conf.term(); + return -2; + } + + ServiceProvider* sp=conf.getServiceProvider(); + sp->lock(); + + Category& log = Category::getInstance(SHIBSP_LOGCAT".Utility.ResolverTest"); + + const Application* app = sp->getApplication(a_param); + if (!app) { + log.error("unknown application ID (%s)", a_param); + sp->unlock(); + conf.term(); + return -3; + } + + try { + ResolutionContext* ctx; + + if (n_param) { + auto_ptr_XMLCh issuer(i_param); + auto_ptr_XMLCh name(n_param); + auto_ptr_XMLCh format(f_param); + + MetadataProvider* m=app->getMetadataProvider(); + xmltooling::Locker mlocker(m); + MetadataProvider::Criteria mc(i_param, &IDPSSODescriptor::ELEMENT_QNAME, protocol); + pair site=m->getEntityDescriptor(mc); + if (!site.first) + throw MetadataException("Unable to locate metadata for IdP ($1).", params(1,i_param)); + + // Build NameID(s). + auto_ptr v2name(saml2::NameIDBuilder::buildNameID()); + v2name->setName(name.get()); + v2name->setFormat(format.get()); + saml1::NameIdentifier* v1name = NULL; + if (!XMLString::equals(protocol, samlconstants::SAML20P_NS)) { + v1name = saml1::NameIdentifierBuilder::buildNameIdentifier(); + v1name->setName(name.get()); + v1name->setFormat(format.get()); + v1name->setNameQualifier(issuer.get()); + } + + ResolverTest rt(NULL, a_param); + try { + ctx = rt.resolveAttributes(*app, site.second, protocol, v1name, v2name.get(), NULL, NULL, NULL); + } + catch (...) { + delete v1name; + throw; + } + } + else { + // Try and load assertion from stdin. + DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(cin); + XercesJanitor docjan(doc); + auto_ptr token(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true)); + docjan.release(); + + // Get the issuer and protocol and NameIDs. + const XMLCh* issuer = NULL; + const saml1::NameIdentifier* v1name = NULL; + saml2::NameID* v2name = NULL; + saml2::Assertion* a2 = dynamic_cast(token.get()); + saml1::Assertion* a1 = dynamic_cast(token.get()); + if (a2) { + const saml2::Issuer* iss = a2->getIssuer(); + issuer = iss ? iss->getName() : NULL; + protocol = samlconstants::SAML20P_NS; + v2name = a2->getSubject() ? a2->getSubject()->getNameID() : NULL; + } + else if (a1) { + issuer = a1->getIssuer(); + if (a1->getMinorVersion().first && a1->getMinorVersion().second == 0) + protocol = samlconstants::SAML10_PROTOCOL_ENUM; + else + protocol = samlconstants::SAML11_PROTOCOL_ENUM; + v1name = a1->getAuthenticationStatements().size() ? + a1->getAuthenticationStatements().front()->getSubject()->getNameIdentifier() : NULL; + // Normalize the SAML 1.x NameIdentifier... + v2name = saml2::NameIDBuilder::buildNameID(); + v2name->setName(v1name->getName()); + v2name->setFormat(v1name->getFormat()); + v2name->setNameQualifier(v1name->getNameQualifier()); + } + else { + throw FatalProfileException("Unknown assertion type."); + } + + if (!issuer) { + if (v1name) + delete v2name; + throw FatalProfileException("Unable to determine issuer."); + } + + MetadataProvider* m=app->getMetadataProvider(); + xmltooling::Locker mlocker(m); + MetadataProvider::Criteria mc(issuer, &IDPSSODescriptor::ELEMENT_QNAME, protocol); + pair site=m->getEntityDescriptor(mc); + if (!site.first) { + auto_ptr_char temp(issuer); + throw MetadataException("Unable to locate metadata for IdP ($1).", params(1,temp.get())); + } + + vector tokens(1, dynamic_cast(token.get())); + ResolverTest rt(NULL, a_param); + try { + ctx = rt.resolveAttributes(*app, site.second, protocol, v1name, v2name, NULL, NULL, &tokens); + } + catch (...) { + if (v1name) + delete v2name; + throw; + } + } + + auto_ptr wrapper(ctx); + for (vector::const_iterator a = ctx->getResolvedAttributes().begin(); a != ctx->getResolvedAttributes().end(); ++a) { + cout << endl; + for (vector::const_iterator s = (*a)->getAliases().begin(); s != (*a)->getAliases().end(); ++s) + cout << "ID: " << *s << endl; + for (vector::const_iterator s = (*a)->getSerializedValues().begin(); s != (*a)->getSerializedValues().end(); ++s) + cout << "Value: " << *s << endl; + } + cout << endl; + } + catch(exception& ex) { + log.error(ex.what()); + sp->unlock(); + conf.term(); + return -10; + } + + sp->unlock(); + conf.term(); + return 0; +} diff --git a/util/resolvertest.vcproj b/util/resolvertest.vcproj new file mode 100644 index 0000000..a8600d1 --- /dev/null +++ b/util/resolvertest.vcproj @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.1.4