[cpp-sp-resolver] branch master updated: Code fixes and updated build files for 3.0.

Scott Cantor cantor.2 at osu.edu
Fri Jul 20 14:10:58 EDT 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-sp-resolver.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp-resolver.git;a=commit;h=f10d837fe009ec4f0659491426217159686fdb58

The following commit(s) were added to refs/heads/master by this push:
       new  f10d837   Code fixes and updated build files for 3.0.
f10d837 is described below

commit f10d837fe009ec4f0659491426217159686fdb58
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Jul 20 14:10:52 2018 -0400

    Code fixes and updated build files for 3.0.
---
 .gitignore                                         |   3 +
 Makefile.am                                        |  16 +-
 Portfile.in                                        |  22 -
 config_win32.h                                     |  19 +-
 configure.ac                                       | 407 +++--------------
 m4/acx_pthread.m4                                  | 283 ------------
 m4/ax_pkg_check_modules.m4                         |  69 +++
 m4/ax_pthread.m4                                   | 485 +++++++++++++++++++++
 m4/ax_restore_flags.m4                             |  52 +++
 m4/ax_save_flags.m4                                |  71 +++
 pkgconfig-workarounds/opensuse13/krb5-gssapi.pc    |   7 +
 pkgconfig-workarounds/opensuse13/krb5.pc           |   7 +
 .../opensuse13/mit-krb5-gssapi.pc                  |   7 +
 pkgconfig-workarounds/opensuse13/mit-krb5.pc       |   7 +
 pkgconfig-workarounds/rh5/krb5-gssapi.pc           |   7 +
 pkgconfig-workarounds/rh5/krb5.pc                  |   7 +
 pkgconfig-workarounds/rh5/mit-krb5-gssapi.pc       |   7 +
 pkgconfig-workarounds/rh5/mit-krb5.pc              |   7 +
 pkgconfig-workarounds/rh6/krb5-gssapi.pc           |   7 +
 pkgconfig-workarounds/rh6/krb5.pc                  |   7 +
 pkgconfig-workarounds/rh6/mit-krb5-gssapi.pc       |   7 +
 pkgconfig-workarounds/rh6/mit-krb5.pc              |   7 +
 resolver.spec.in                                   |  66 +--
 shibresolver-lite.pc.in                            |  13 +
 shibresolver.pc.in                                 |  13 +
 src/Makefile.am                                    |  39 +-
 src/shibresolver/resolver.cpp                      |  49 +--
 src/shibresolver/resolver.h                        |   2 +-
 28 files changed, 961 insertions(+), 732 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7b94ed9..b62120d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,4 +55,7 @@ src/x64
 Makefile.in
 Makefile
 *.tar.gz
+*.tar.bz2
+*.zip
+*.pc
 .dirstamp
diff --git a/Makefile.am b/Makefile.am
index c229db7..1b90e02 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,15 +1,17 @@
-AUTOMAKE_OPTIONS = foreign
-
+AUTOMAKE_OPTIONS = foreign dist-zip dist-bzip2
 ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = doc src
 
 DIST_SUBDIRS = doc src
 
-GENFILES = resolver.spec Portfile
+pkgconfig_DATA = shibresolver.pc shibresolver-lite.pc
+
+GENFILES = resolver.spec
 
 EXTRA_DIST = \
-    cpp-sp-resolver.sln \
-    $(GENFILES) \
-    $(GENFILES:%=%.in) \
-    config_win32.h
+	cpp-sp-resolver.sln \
+	$(GENFILES) \
+	$(GENFILES:%=%.in) \
+	config_win32.h \
+	pkgconfig-workarounds
diff --git a/Portfile.in b/Portfile.in
deleted file mode 100644
index 76e3175..0000000
--- a/Portfile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-PortSystem 1.0
-
-name                @PACKAGE@
-version             @PACKAGE_VERSION@
-categories          security shibboleth
-maintainers         cantor.2 at osu.edu
-description         @PACKAGE@ extension for Shibboleth SP
-long_description    @PACKAGE@ extension for Shibboleth SP
-homepage            http://shibboleth.internet2.edu/
-
-platforms           darwin
-depends_lib         port:shibboleth
-
-master_sites        http://shibboleth.internet2.edu/downloads/extensions/sp/
-checksums           sha1 @CHECKSUM@
-
-configure.args      --disable-static \
-                    --with-xerces=${prefix} \
-                    --with-xmlsec=${prefix} \
-                    --with-xmltooling=${prefix} \
-                    --with-saml=${prefix} \
-                    --with-shibsp=${prefix}
diff --git a/config_win32.h b/config_win32.h
index eb5c3a5..dc4de17 100644
--- a/config_win32.h
+++ b/config_win32.h
@@ -1,13 +1,5 @@
 /* config_win32.h.  Copied from a ./configure on Unix */
 
-/* Define if C++ compiler supports covariant virtual methods. */
-#define HAVE_COVARIANT_RETURNS 1
-
-/* Define to 1 if C++ compiler supports nullptr keyword. */
-#if _MSC_VER >= 1600
-# define HAVE_NULLPTR 1
-#endif
-
 /* Define to 1 if you have the <dlfcn.h> header file. */
 /* #undef HAVE_DLFCN_H */
 
@@ -35,9 +27,6 @@
 /* Define if you have POSIX threads libraries and header files. */
 /* #undef HAVE_PTHREAD */
 
-/* Define to 1 if Shibboleth SP supports non-plugin remoting. */
-#define SHIBRESOLVER_SHIBSP_HAS_REMOTING 1
-
 /* Define to 1 if you have the <stdint.h> header file. */
 /* #undef HAVE_STDINT_H */
 
@@ -60,19 +49,19 @@
 #define PACKAGE "shibboleth-resolver"
 
 /* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "shibboleth-users at internet2.edu"
+#define PACKAGE_BUGREPORT "https://issues.shibboleth.net"
 
 /* Define to the full name of this package. */
 #define PACKAGE_NAME "shibboleth-resolver"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "shibboleth-resolver 0.2"
+#define PACKAGE_STRING "shibboleth-resolver 3.0.0"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "shibboleth-resolver"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "0.2"
+#define PACKAGE_VERSION "3.0.0"
 
 /* Define to the necessary symbol if this constant uses a non-standard name on
    your system. */
@@ -85,7 +74,7 @@
 /* #undef TM_IN_SYS_TIME */
 
 /* Version number of package */
-#define VERSION "0.2"
+#define VERSION "3.0.0"
 
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
diff --git a/configure.ac b/configure.ac
index cddf473..5f18515 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,7 @@ AC_CONFIG_MACRO_DIR(m4)
 AM_INIT_AUTOMAKE
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
+PKG_INSTALLDIR
 
 AC_ARG_ENABLE(debug,
     AS_HELP_STRING([--enable-debug],[Have GCC compile with symbols (Default = no)]),
@@ -20,7 +21,7 @@ else
 fi
 
 AC_CONFIG_HEADERS([config.h src/shibresolver/config_pub.h])
-AC_CONFIG_FILES([resolver.spec Portfile])
+AC_CONFIG_FILES([resolver.spec shibresolver.pc shibresolver-lite.pc])
 AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile])
 
 AC_PROG_CC([gcc gcc3 cc])
@@ -61,16 +62,7 @@ AC_STRUCT_TM
 # Checks for library functions.
 AC_CHECK_FUNCS([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
+AX_PTHREAD(,[AC_MSG_ERROR([unable to find pthreads, currently this is required])])
 
 AC_LANG(C++)
 
@@ -78,330 +70,53 @@ AC_LANG(C++)
 AC_CXX_NAMESPACES
 AC_CXX_REQUIRE_STL
 
-# are covariant methods allowed?
-AC_LINK_IFELSE(
-    [AC_LANG_PROGRAM([[]],
-        [[
-        class base { public: virtual base *GetPtr( void ) { return this; } };
-        class derived: virtual public base { public: virtual derived *GetPtr( void ) { return this; } };
-        ]])],
-    [AC_DEFINE([HAVE_COVARIANT_RETURNS],[1],[Define to 1 if C++ compiler supports covariant virtual methods.])])
-
-# is nullptr supported?
-AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM([[]],[[const char* ptr = nullptr;]])],
-    [AC_DEFINE([HAVE_NULLPTR],[1],[Define to 1 if C++ compiler supports nullptr keyword.])])
-
-# log4shib settings (favor this version over the log4cpp code)
-AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
-AC_ARG_WITH(log4shib,
-    AS_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
-    LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
-    CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
-	AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
-    AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
-#include <log4shib/CategoryStream.hh>]],
-            [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
-        [AC_DEFINE([SHIBRESOLVER_LOG4SHIB],[1],[Define to 1 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,
-	    AS_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])
-	    LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
-	    CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
-		AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
-        AC_LINK_IFELSE(
-            [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
-#include <log4cpp/CategoryStream.hh>]],
-                [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
-            [AC_DEFINE([SHIBRESOLVER_LOG4CPP],[1],[Define to 1 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
-# Xerces settings
-AC_ARG_WITH(xerces,
-    AS_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 <xercesc/util/XercesVersion.hpp>],
-[#if  _XERCES_VERSION >= 30000
-int i = 0;
-#else
-#error cannot use version 1.x or 2.x
-#endif])],
-    [AC_MSG_RESULT(OK)],
-    [AC_MSG_FAILURE([Xerces-C 3.x is required])])
-
-AC_LINK_IFELSE(
-    [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],
-        [[xercesc::XMLPlatformUtils::Initialize()]])],
-    ,[AC_MSG_ERROR([unable to link with Xerces])])
-
-
-#XML-Tooling settings
-AC_ARG_WITH(xmltooling,
-    AS_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]))
-
-# XML-Security settings
-AC_ARG_WITH(xmlsec,
-    AS_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 <xsec/utils/XSECPlatformUtils.hpp>],
-    [#if XSEC_VERSION_MAJOR >= 2
-int i = 0;
-#else
-#error need version 2.0.0 or later
-#endif])],
-    [AC_MSG_RESULT(OK)],
-    [AC_MSG_FAILURE([XML-Security version 2.0.0 or greater is required.])])
-AC_LINK_IFELSE(
-    [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
-        [[XSECPlatformUtils::Initialise()]])],,
-    [AC_MSG_ERROR([unable to link with XML-Security])])
-
-# restore master libs
-LIBS="$save_LIBS"
-
-# OpenSAML settings
-AC_ARG_WITH(saml,
-    AS_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_LINK_IFELSE(
-    [AC_LANG_PROGRAM([[#include <saml/SAMLConfig.h>]],
-    [[opensaml::SAMLConfig::getConfig()]])],
-    ,[AC_MSG_ERROR([unable to link with OpenSAML])])
-
-# restore master libs
-LIBS="$save_LIBS"
-
-# Shibboleth SP settings
-AC_ARG_WITH(shibsp,
-    AS_HELP_STRING([--with-shibsp=PATH],[where Shibboleth SP is installed]),
-    [if test x_$with_shibsp != x_/usr; then
-        LDFLAGS="-L${with_shibsp}/lib $LDFLAGS"
-        CPPFLAGS="-I${with_shibsp}/include $CPPFLAGS"
-    fi])
-LITE_LIBS="-lshibsp-lite $LITE_LIBS"
-XMLSEC_LIBS="-lshibsp $XMLSEC_LIBS"
-
-# save and append master libs
-save_LIBS="$LIBS"
-LIBS="$XMLSEC_LIBS $LIBS"
-
-AC_CHECK_HEADER([shibsp/SPConfig.h],,AC_MSG_ERROR([unable to find Shibboleth SP header files]))
-AC_LINK_IFELSE(
-    [AC_LANG_PROGRAM([[#include <shibsp/SPConfig.h>]],
-    [[shibsp::SPConfig::getConfig()]])],
-    ,[AC_MSG_ERROR([unable to link with Shibboleth SP])])
-
-AC_MSG_CHECKING([whether SP library supports non-plugin remoting])
-AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM(
-    [[
-#include <vector>
-#include <shibsp/ServiceProvider.h>
-    ]],
-    [[shibsp::ServiceProvider* sp; sp->regListener(NULL,NULL);]])],
-    [AC_MSG_RESULT([yes])AC_DEFINE([SHIBRESOLVER_SHIBSP_HAS_REMOTING],[1],[Define to 1 if Shibboleth SP supports non-plugin remoting.])],
-    [AC_MSG_RESULT([no])])
-
-# restore master libs
-LIBS="$save_LIBS"
-
-# GSS-API checking
-
-GSSAPI_ROOT="/usr"
-AC_ARG_WITH(gssapi-includes,
-  AS_HELP_STRING([--with-gssapi-includes=DIR],[Specify location of GSSAPI header]),
-  [ GSSAPI_INCS="-I$withval"
-    want_gss="yes" ]
-)
-
-AC_ARG_WITH(gssapi-libs,
-  AS_HELP_STRING([--with-gssapi-libs=DIR],[Specify location of GSSAPI libs]),
-  [ GSSAPI_LIB_DIR="-L$withval"
-    want_gss="yes" ]
-)
-
-AC_ARG_WITH(gssapi,
-  AS_HELP_STRING([--with-gssapi=DIR],[Where to look for GSSAPI]),
-  [ GSSAPI_ROOT="$withval"
-  if test x"$GSSAPI_ROOT" != xno; then
-    want_gss="yes"
-    if test x"$GSSAPI_ROOT" = xyes; then
-      dnl if yes, then use default root
-      GSSAPI_ROOT="/usr"
-    fi
-  fi
-])
-
-save_CPPFLAGS="$CPPFLAGS"
-AC_MSG_CHECKING([if GSSAPI support is requested])
-if test x"$want_gss" = xyes; then
-  AC_MSG_RESULT(yes)
-
-  if test -z "$GSSAPI_INCS"; then
-     if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
-        GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
-     elif test "$GSSAPI_ROOT" != "yes"; then
-        GSSAPI_INCS="-I$GSSAPI_ROOT/include"
-     fi
-  fi
-
-  CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
-
-  AC_CHECK_HEADER(gss.h,
-    [
-      dnl found in the given dirs
-      AC_DEFINE([SHIBRESOLVER_HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])
-      gnu_gss=yes
-    ],
-    [
-      dnl not found, check Heimdal or MIT
-      AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
-      AC_CHECK_HEADERS(
-        [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
-        [],
-        [not_mit=1],
-        [
-AC_INCLUDES_DEFAULT
-#ifdef HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#endif
-        ])
-      if test "x$not_mit" = "x1"; then
-        dnl MIT not found, check for Heimdal
-        AC_CHECK_HEADER([gssapi.h],
-            [
-              dnl found
-              AC_DEFINE([SHIBRESOLVER_HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])
-            ],
-            [
-              dnl no header found, disabling GSS
-              want_gss=no
-              AC_MSG_WARN([disabling GSSAPI since no header files was found])
-            ]
-          )
-      else
-        dnl MIT found
-        AC_DEFINE([SHIBRESOLVER_HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])
-        dnl check if we have a really old MIT kerberos (<= 1.2)
-        AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
-        AC_COMPILE_IFELSE([
-          AC_LANG_PROGRAM([[
-#include <gssapi/gssapi.h>
-#include <gssapi/gssapi_generic.h>
-#include <gssapi/gssapi_krb5.h>
-          ]],[[
-            gss_import_name(
-                            (OM_uint32 *)0,
-                            (gss_buffer_t)0,
-                            GSS_C_NT_HOSTBASED_SERVICE,
-                            (gss_name_t *)0);
-          ]])
-        ],[
-          AC_MSG_RESULT([yes])
-        ],[
-          AC_MSG_RESULT([no])
-          AC_DEFINE([HAVE_OLD_GSSMIT],[1],[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
-        ])
-      fi
-    ]
-  )
-else
-  AC_MSG_RESULT(no)
-fi
-if test x"$want_gss" = xyes; then
-  AC_DEFINE([SHIBRESOLVER_HAVE_GSSAPI],[1],[if you have the gssapi libraries])
-
-  if test -n "$gnu_gss"; then
-    LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
-    LIBS="$LIBS -lgss"
-  else
-    if test -z "$GSSAPI_LIB_DIR"; then
-      GSSAPI_LIB_DIR="$GSSAPI_ROOT/lib$libsuff"
-    fi
-    if test "$GSSAPI_ROOT" != "yes"; then
-       LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
-    fi
-    if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
-      dnl krb5-config does not have --libs-only-L or similar, put everything into LIBS
-      gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
-    else
-      if test "x$not_mit" = "x1"; then
-        gss_libs="-lgssapi"
-      else
-        gss_libs="-lgssapi_krb5"
-      fi
-    fi
-    LIBS="$LIBS $gss_libs"
-  fi
-
-  AC_MSG_CHECKING([whether GSS-API naming extensions are available])
-  AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM([[
+AX_PKG_CHECK_MODULES([log4shib],,[log4shib],
+    [AC_DEFINE([SHIBRESOLVER_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
+    [AX_PKG_CHECK_MODULES([log4cpp],,[log4cpp],
+        [AC_DEFINE([SHIBRESOLVER_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],,
+        [SHIBRESOLVER_LITE_REQUIRES],[SHIBRESOLVER_LITE_REQUIRES_PRIVATE])],,
+    [SHIBRESOLVER_LITE_REQUIRES],[SHIBRESOLVER_LITE_REQUIRES_PRIVATE])
+
+AX_PKG_CHECK_MODULES([xerces],,[xerces-c >= 3.2],,,
+    [SHIBRESOLVER_LITE_REQUIRES],[SHIBRESOLVER_LITE_REQUIRES_PRIVATE])
+
+AX_PKG_CHECK_MODULES([xmlsec],,[xml-security-c >= 2],,,
+    [SHIBRESOLVER_REQUIRES],[SHIBRESOLVER_REQUIRES_PRIVATE])
+
+AX_PKG_CHECK_MODULES([xmltooling],,[xmltooling >= 3],,,
+    [SHIBRESOLVER_REQUIRES],[SHIBRESOLVER_REQUIRES_PRIVATE])
+
+AX_PKG_CHECK_MODULES([xmltooling_lite],,[xmltooling-lite >= 3],,,
+    [SHIBRESOLVER_LITE_REQUIRES],[SHIBRESOLVER_LITE_REQUIRES_PRIVATE])
+
+AX_PKG_CHECK_MODULES([opensaml],,[opensaml >= 3],,,
+    [SHIBRESOLVER_REQUIRES],[SHIBRESOLVER_REQUIRES_PRIVATE])
+
+AX_PKG_CHECK_MODULES([shibsp],,[shibsp >= 3],,,
+    [SHIBRESOLVER_REQUIRES],[SHIBRESOLVER_REQUIRES_PRIVATE])
+
+AX_PKG_CHECK_MODULES([shibsp_lite],,[shibsp-lite >= 3],,,
+    [SHIBRESOLVER_LITE_REQUIRES],[SHIBRESOLVER_LITE_REQUIRES_PRIVATE])
+
+AC_ARG_WITH([gssapi],
+  [AS_HELP_STRING([--with-gssapi],[include GSSAPI support])],,[with_gssapi=check])
+AS_IF([test "x$with_gssapi" != xno],
+  [AX_PKG_CHECK_MODULES([gss],,[krb5-gssapi],
+     [PKG_CHECK_VAR([GSS_VENDOR],[krb5-gssapi],[vendor])
+      AS_CASE(["$GSS_VENDOR"],
+        [Heimdal],[AC_DEFINE([SHIBRESOLVER_HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])],
+        [MIT],[AC_DEFINE([SHIBRESOLVER_HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])])],
+     [AX_PKG_CHECK_MODULES([gnu_gss],,[gss],
+        [AC_DEFINE([SHIBRESOLVER_HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])],
+        [with_gssapi=no],
+        [SHIBRESOLVER_LITE_REQUIRES],[SHIBRESOLVER_LITE_REQUIRES_PRIVATE])],
+     [SHIBRESOLVER_LITE_REQUIRES],[SHIBRESOLVER_LITE_REQUIRES_PRIVATE])
+   AS_IF([test "x$with_gssapi" != xno],
+     [AC_DEFINE([SHIBRESOLVER_HAVE_GSSAPI],[1],[if you have the gssapi libraries])
+      AX_SAVE_FLAGS
+        CXXFLAGS="$gss_CFLAGS $gnu_gss_CFLAGS $CXXFLAGS"
+        LIBS="$gss_LIBS $gnu_gss_LIBS $LIBS"
+      AC_CHECK_DECLS([gss_get_name_attribute,GSS_C_NT_EXPORT_NAME_COMPOSITE],,,[[
 #ifdef SHIBRESOLVER_HAVE_GSSGNU
 # include <gss.h>
 #elif defined SHIBRESOLVER_HAVE_GSSMIT
@@ -409,19 +124,13 @@ if test x"$want_gss" = xyes; then
 # include <gssapi/gssapi_ext.h>
 #else
 # include <gssapi.h>
-#endif]],
-    [[gss_get_name_attribute(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);]])],
-    [AC_MSG_RESULT([yes])AC_DEFINE([SHIBRESOLVER_HAVE_GSSAPI_NAMINGEXTS],[1],[Define to 1 if GSS-API naming extensions are available.])],
-    [AC_MSG_RESULT([no])])
-
-else
-  CPPFLAGS="$save_CPPFLAGS"
-fi
-
-
-AC_SUBST(LITE_LIBS)
-AC_SUBST(XMLSEC_LIBS)
-
-LIBTOOL="$LIBTOOL --silent"
+#endif
+]])
+      AX_RESTORE_FLAGS
+     ])
+  ])
+  
+AC_DEFINE([SHIBRESOLVER_HAVE_GSSAPI_NAMINGEXTS],[test "x$ac_cv_have_decl_gss_get_name_attribute" = xyes],[Define to 1 if GSS-API naming extensions are available.])
+AM_CONDITIONAL([GSSAPI_NAMINGEXTS],[test "x$ac_cv_have_decl_gss_get_name_attribute" = xyes])
 
 AC_OUTPUT
diff --git a/m4/acx_pthread.m4 b/m4/acx_pthread.m4
deleted file mode 100644
index 4e9c8cb..0000000
--- a/m4/acx_pthread.m4
+++ /dev/null
@@ -1,283 +0,0 @@
-##### 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 <stevenj at alum.mit.edu>
-#
-#   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_PUSH([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_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[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_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[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_POP
-])dnl ACX_PTHREAD
diff --git a/m4/ax_pkg_check_modules.m4 b/m4/ax_pkg_check_modules.m4
new file mode 100644
index 0000000..0ddaad8
--- /dev/null
+++ b/m4/ax_pkg_check_modules.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+#   https://www.gnu.org/software/autoconf-archive/ax_pkg_check_modules.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PKG_CHECK_MODULES(PREFIX, PUBLIC-MODULES, PRIVATE-MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [PUBLIC-VARIABLE], [PRIVATE-VARIABLE])
+#
+# DESCRIPTION
+#
+#   A wrapper around PKG_CHECK_MODULES which splits the list of modules into
+#   public and private dependencies, and produces two variables listing the
+#   dependencies across all invocations of AX_PKG_CHECK_MODULES. These two
+#   variables are exposed via AC_SUBST, and should be used in a pkg-config
+#   file as the substituted values for Requires and Requires.private.
+#
+#   The PREFIX, PUBLIC-MODULES and PRIVATE-MODULES arguments should be
+#   specified as for PKG_CHECK_MODULES, with the concatenation of
+#   PUBLIC-MODULES and PRIVATE-MODULES equaling the LIST-OF-MODULES from
+#   PKG_CHECK_MODULES.  The ACTION-IF-FOUND and ACTION-IF-NOT-FOUND
+#   arguments are optional, and should also be specified as for
+#   PKG_CHECK_MODULES.  ACTION-IF-FOUND is evaluated if the full
+#   LIST-OF-MODULES is found; ACTION-IF-NOT-FOUND similarly.
+#
+#   PUBLIC-VARIABLE defaults to AX_PACKAGE_REQUIRES, and PRIVATE-VARIABLE
+#   defaults to AX_PACKAGE_REQUIRES_PRIVATE.  Both variables are AC_SUBST-ed
+#   by this macro.
+#
+#   For example:
+#
+#     AX_PKG_CHECK_MODULES([GLIB],[glib-2.0 gio-2.0],[gthread-2.0])
+#     AX_PKG_CHECK_MODULES([DBUS],[],[dbus-glib-1 >= 0.98 dbus-1])
+#
+#   results in the substitutions:
+#
+#     AX_PACKAGE_REQUIRES="glib-2.0 gio-2.0"
+#     AX_PACKAGE_REQUIRES_PRIVATE="gthread-2.0 dbus-glib-1 >= 0.98 dbus-1"
+#
+#   and can be used with a template pkg-config file (.pc.in) using:
+#
+#     Requires: @AX_PACKAGE_REQUIRES@
+#     Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
+#
+# LICENSE
+#
+#   Copyright (c) 2014 Philip Withnall <philip at tecnocode.co.uk>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 4 (changed as https://bugs.freedesktop.org/show_bug.cgi?id=87154)
+
+AC_DEFUN([AX_PKG_CHECK_MODULES],[
+    m4_define([ax_package_requires],
+              [m4_default_quoted([$6],[AX_PACKAGE_REQUIRES])])
+    m4_define([ax_package_requires_private],
+              [m4_default_quoted([$7],[AX_PACKAGE_REQUIRES_PRIVATE])])
+
+    PKG_CHECK_MODULES([$1],[$2 $3],[
+        ax_package_requires="$[]ax_package_requires m4_normalize($2)"
+        ax_package_requires_private="$[]ax_package_requires_private m4_normalize($3)"
+        $4],[$5])
+
+    # Substitute output.
+    AC_SUBST(ax_package_requires)
+    AC_SUBST(ax_package_requires_private)
+])dnl AX_PKG_CHECK_MODULES
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
new file mode 100644
index 0000000..4c4051e
--- /dev/null
+++ b/m4/ax_pthread.m4
@@ -0,0 +1,485 @@
+# ===========================================================================
+#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_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 to link with them as well. For example, you might link with
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+#   If you are only building threaded 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, this macro defines PTHREAD_CREATE_JOINABLE to
+#   that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+#   PTHREAD_CFLAGS.
+#
+#   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.
+#
+#   Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
+#   Copyright (c) 2011 Daniel Richard G. <skunk at iSKUNK.ORG>
+#
+#   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 3 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, see <http://www.gnu.org/licenses/>.
+#
+#   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 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.
+
+#serial 23
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_SED])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on Tru64 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_CFLAGS$PTHREAD_LIBS" != "x"; then
+        ax_pthread_save_CC="$CC"
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
+        AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
+        AC_MSG_RESULT([$ax_pthread_ok])
+        if test "x$ax_pthread_ok" = "xno"; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        CC="$ax_pthread_save_CC"
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+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.
+
+ax_pthread_flags="pthreads none -Kthread -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)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
+#           (Note: HP C rejects this with "bad form for `-t' option")
+# -pthreads: Solaris/gcc (Note: HP C also rejects)
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads and
+#      -D_REENTRANT too), HP C (must be checked before -lpthread, which
+#      is present but should not be used directly; and before -mthreads,
+#      because the compiler interprets this as "-mt" + "-hreads")
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case $host_os in
+
+        freebsd*)
+
+        # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+        # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+
+        ax_pthread_flags="-kthread lthread $ax_pthread_flags"
+        ;;
+
+        hpux*)
+
+        # From the cc(1) man page: "[-mt] Sets various -D flags to enable
+        # multi-threading and also sets -lpthread."
+
+        ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
+        ;;
+
+        openedition*)
+
+        # IBM z/OS requires a feature-test macro to be defined in order to
+        # enable POSIX threads at all, so give the user a hint if this is
+        # not set. (We don't define these ourselves, as they can affect
+        # other portions of the system API in unpredictable ways.)
+
+        AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
+            [
+#            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
+             AX_PTHREAD_ZOS_MISSING
+#            endif
+            ],
+            [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
+        ;;
+
+        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. (N.B.: 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 check first for the
+        # standard Solaris way of linking pthreads (-mt -lpthread).
+
+        ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
+        ;;
+esac
+
+# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
+
+AS_IF([test "x$GCC" = "xyes"],
+      [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
+
+# The presence of a feature test macro requesting re-entrant function
+# definitions is, on some systems, a strong hint that pthreads support is
+# correctly enabled
+
+case $host_os in
+        darwin* | hpux* | linux* | osf* | solaris*)
+        ax_pthread_check_macro="_REENTRANT"
+        ;;
+
+        aix*)
+        ax_pthread_check_macro="_THREAD_SAFE"
+        ;;
+
+        *)
+        ax_pthread_check_macro="--"
+        ;;
+esac
+AS_IF([test "x$ax_pthread_check_macro" = "x--"],
+      [ax_pthread_check_cond=0],
+      [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
+
+# Are we compiling with Clang?
+
+AC_CACHE_CHECK([whether $CC is Clang],
+    [ax_cv_PTHREAD_CLANG],
+    [ax_cv_PTHREAD_CLANG=no
+     # Note that Autoconf sets GCC=yes for Clang as well as GCC
+     if test "x$GCC" = "xyes"; then
+        AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
+            [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
+#            if defined(__clang__) && defined(__llvm__)
+             AX_PTHREAD_CC_IS_CLANG
+#            endif
+            ],
+            [ax_cv_PTHREAD_CLANG=yes])
+     fi
+    ])
+ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
+
+ax_pthread_clang_warning=no
+
+# Clang needs special handling, because older versions handle the -pthread
+# option in a rather... idiosyncratic way
+
+if test "x$ax_pthread_clang" = "xyes"; then
+
+        # Clang takes -pthread; it has never supported any other flag
+
+        # (Note 1: This will need to be revisited if a system that Clang
+        # supports has POSIX threads in a separate library.  This tends not
+        # to be the way of modern systems, but it's conceivable.)
+
+        # (Note 2: On some systems, notably Darwin, -pthread is not needed
+        # to get POSIX threads support; the API is always present and
+        # active.  We could reasonably leave PTHREAD_CFLAGS empty.  But
+        # -pthread does define _REENTRANT, and while the Darwin headers
+        # ignore this macro, third-party headers might not.)
+
+        PTHREAD_CFLAGS="-pthread"
+        PTHREAD_LIBS=
+
+        ax_pthread_ok=yes
+
+        # However, older versions of Clang make a point of warning the user
+        # that, in an invocation where only linking and no compilation is
+        # taking place, the -pthread option has no effect ("argument unused
+        # during compilation").  They expect -pthread to be passed in only
+        # when source code is being compiled.
+        #
+        # Problem is, this is at odds with the way Automake and most other
+        # C build frameworks function, which is that the same flags used in
+        # compilation (CFLAGS) are also used in linking.  Many systems
+        # supported by AX_PTHREAD require exactly this for POSIX threads
+        # support, and in fact it is often not straightforward to specify a
+        # flag that is used only in the compilation phase and not in
+        # linking.  Such a scenario is extremely rare in practice.
+        #
+        # Even though use of the -pthread flag in linking would only print
+        # a warning, this can be a nuisance for well-run software projects
+        # that build with -Werror.  So if the active version of Clang has
+        # this misfeature, we search for an option to squash it.
+
+        AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
+            [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
+            [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+             # Create an alternate version of $ac_link that compiles and
+             # links in two steps (.c -> .o, .o -> exe) instead of one
+             # (.c -> exe), because the warning occurs only in the second
+             # step
+             ax_pthread_save_ac_link="$ac_link"
+             ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
+             ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
+             ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
+             ax_pthread_save_CFLAGS="$CFLAGS"
+             for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
+                AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
+                CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
+                ac_link="$ax_pthread_save_ac_link"
+                AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+                    [ac_link="$ax_pthread_2step_ac_link"
+                     AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+                         [break])
+                    ])
+             done
+             ac_link="$ax_pthread_save_ac_link"
+             CFLAGS="$ax_pthread_save_CFLAGS"
+             AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
+             ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
+            ])
+
+        case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
+                no | unknown) ;;
+                *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
+        esac
+
+fi # $ax_pthread_clang = yes
+
+if test "x$ax_pthread_ok" = "xno"; then
+for ax_pthread_try_flag in $ax_pthread_flags; do
+
+        case $ax_pthread_try_flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -mt,pthread)
+                AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
+                PTHREAD_CFLAGS="-mt"
+                PTHREAD_LIBS="-lpthread"
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
+                PTHREAD_CFLAGS="$ax_pthread_try_flag"
+                ;;
+
+                pthread-config)
+                AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
+                AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
+                PTHREAD_LIBS="-l$ax_pthread_try_flag"
+                ;;
+        esac
+
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # 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_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
+#                       if $ax_pthread_check_cond
+#                        error "$ax_pthread_check_macro must be defined"
+#                       endif
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }],
+                       [pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */])],
+            [ax_pthread_ok=yes],
+            [])
+
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+
+        AC_MSG_RESULT([$ax_pthread_ok])
+        AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = "xyes"; then
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        AC_CACHE_CHECK([for joinable pthread attribute],
+            [ax_cv_PTHREAD_JOINABLE_ATTR],
+            [ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+             for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+                 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
+                                                 [int attr = $ax_pthread_attr; return attr /* ; */])],
+                                [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
+                                [])
+             done
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
+               test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
+               test "x$ax_pthread_joinable_attr_defined" != "xyes"],
+              [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
+                                  [$ax_cv_PTHREAD_JOINABLE_ATTR],
+                                  [Define to necessary symbol if this constant
+                                   uses a non-standard name on your system.])
+               ax_pthread_joinable_attr_defined=yes
+              ])
+
+        AC_CACHE_CHECK([whether more special flags are required for pthreads],
+            [ax_cv_PTHREAD_SPECIAL_FLAGS],
+            [ax_cv_PTHREAD_SPECIAL_FLAGS=no
+             case $host_os in
+             solaris*)
+             ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
+             ;;
+             esac
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
+               test "x$ax_pthread_special_flags_added" != "xyes"],
+              [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
+               ax_pthread_special_flags_added=yes])
+
+        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+            [ax_cv_PTHREAD_PRIO_INHERIT],
+            [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+                                             [[int i = PTHREAD_PRIO_INHERIT;]])],
+                            [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+                            [ax_cv_PTHREAD_PRIO_INHERIT=no])
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
+               test "x$ax_pthread_prio_inherit_defined" != "xyes"],
+              [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
+               ax_pthread_prio_inherit_defined=yes
+              ])
+
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+
+        # More AIX lossage: compile with *_r variant
+        if test "x$GCC" != "xyes"; then
+            case $host_os in
+                aix*)
+                AS_CASE(["x/$CC"],
+                    [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+                    [#handle absolute path differently from PATH based program lookup
+                     AS_CASE(["x$CC"],
+                         [x/*],
+                         [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
+                         [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
+                ;;
+            esac
+        fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test "x$ax_pthread_ok" = "xyes"; then
+        ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
+        :
+else
+        ax_pthread_ok=no
+        $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
diff --git a/m4/ax_restore_flags.m4 b/m4/ax_restore_flags.m4
new file mode 100644
index 0000000..aafd363
--- /dev/null
+++ b/m4/ax_restore_flags.m4
@@ -0,0 +1,52 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_restore_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_RESTORE_FLAGS([namespace])
+#
+# DESCRIPTION
+#
+#   Restore common compilation flags from temporary variables.
+#
+#   Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
+#   OBJCFLAGS.
+#
+#   By default these flags are restored to a global (empty) namespace, but
+#   user could restore from specific NAMESPACE by using
+#   AX_RESTORE_FLAGS(NAMESPACE) macro.
+#
+#   Typical usage is like:
+#
+#     AX_SAVE_FLAGS(mypackage)
+#     CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
+#     dnl ... do some detection ...
+#     AX_RESTORE_FLAGS(mypackage)
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Filippo Giunchedi <filippo at esaurito.net>
+#   Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University
+#   Copyright (c) 2011 Russ Allbery <rra at stanford.edu>
+#   Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf at gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 6
+
+# save one flag in name space
+AC_DEFUN([_AX_RESTORE_ONE_FLAG],[dnl
+  AS_VAR_PUSHDEF([_ax_restore_flag_var], [$2[]_$1[]_ax_save_flags])
+  AS_VAR_COPY($2[],_ax_restore_flag_var)
+  AS_VAR_POPDEF([_ax_restore_flag_var])
+])
+
+AC_DEFUN([AX_RESTORE_FLAGS], [dnl
+   m4_foreach([FLAG], dnl
+	      [_AX_SAVE_FLAGS_LIST()], dnl
+	      [_AX_RESTORE_ONE_FLAG([$1],FLAG)])
+])
diff --git a/m4/ax_save_flags.m4 b/m4/ax_save_flags.m4
new file mode 100644
index 0000000..39f45be
--- /dev/null
+++ b/m4/ax_save_flags.m4
@@ -0,0 +1,71 @@
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_save_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_SAVE_FLAGS([NAMESPACE])
+#
+# DESCRIPTION
+#
+#   Save common compilation flags into temporary variables.
+#
+#   Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
+#   OBJCFLAGS.
+#
+#   By default these flags are saved to a global (empty) namespace, but user
+#   could specify a specific NAMESPACE to AX_SAVE_FLAGS macro and latter
+#   restore it by using AX_RESTORE_FLAGS(NAMESPACE).
+#
+#     AX_SAVE_FLAGS(mypackage)
+#     CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
+#     dnl .. do some detection ...
+#     AX_RESTORE_FLAGS(mypackage)
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Filippo Giunchedi <filippo at esaurito.net>
+#   Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University
+#   Copyright (c) 2011 Russ Allbery <rra at stanford.edu>
+#   Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf at gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 7
+
+# list of flag to save
+AC_DEFUN([_AX_SAVE_FLAGS_LIST],[dnl
+[CCASFLAGS],dnl
+[CFLAGS],dnl
+[CPPFLAGS],dnl
+[CXXFLAGS],dnl
+[ERLCFLAGS],dnl
+[FCFLAGS],dnl
+[FCLIBS],dnl
+[FFLAGS],dnl
+[FLIBS],dnl
+[GCJFLAGS],dnl
+[JAVACFLAGS],dnl
+[LDFLAGS],dnl
+[LIBS],dnl
+[OBJCFLAGS],dnl
+[OBJCXXFLAGS],dnl
+[UPCFLAGS],dnl
+[VALAFLAGS]dnl
+])
+
+# save one flag in name space
+AC_DEFUN([_AX_SAVE_ONE_FLAG],[
+  AS_VAR_PUSHDEF([_ax_save_flag_var], [$2[]_$1[]_ax_save_flags])
+  AS_VAR_COPY(_ax_save_flag_var, $2[])
+  AS_VAR_POPDEF([_ax_save_flag_var])
+])
+
+AC_DEFUN([AX_SAVE_FLAGS],[dnl
+   m4_foreach([FLAG], dnl
+	      [_AX_SAVE_FLAGS_LIST()], dnl
+	      [_AX_SAVE_ONE_FLAG([$1],FLAG)])
+])
diff --git a/pkgconfig-workarounds/opensuse13/krb5-gssapi.pc b/pkgconfig-workarounds/opensuse13/krb5-gssapi.pc
new file mode 100644
index 0000000..ee34987
--- /dev/null
+++ b/pkgconfig-workarounds/opensuse13/krb5-gssapi.pc
@@ -0,0 +1,7 @@
+vendor=MIT
+
+Name: krb5-gssapi
+Description: Kerberos implementation of the GSSAPI
+Version: 1.12.2
+Requires: mit-krb5-gssapi
+
diff --git a/pkgconfig-workarounds/opensuse13/krb5.pc b/pkgconfig-workarounds/opensuse13/krb5.pc
new file mode 100644
index 0000000..86b4776
--- /dev/null
+++ b/pkgconfig-workarounds/opensuse13/krb5.pc
@@ -0,0 +1,7 @@
+vendor=MIT
+
+Name: krb5
+Description: An implementation of Kerberos network authentication
+Version: 1.12.2
+Requires: mit-krb5
+
diff --git a/pkgconfig-workarounds/opensuse13/mit-krb5-gssapi.pc b/pkgconfig-workarounds/opensuse13/mit-krb5-gssapi.pc
new file mode 100644
index 0000000..6db5e9c
--- /dev/null
+++ b/pkgconfig-workarounds/opensuse13/mit-krb5-gssapi.pc
@@ -0,0 +1,7 @@
+Name: mit-krb5-gssapi
+Description: Kerberos implementation of the GSSAPI
+Version: 1.12.2
+Requires.private: mit-krb5
+Cflags:
+Libs: -lgssapi_krb5
+
diff --git a/pkgconfig-workarounds/opensuse13/mit-krb5.pc b/pkgconfig-workarounds/opensuse13/mit-krb5.pc
new file mode 100644
index 0000000..f62d84b
--- /dev/null
+++ b/pkgconfig-workarounds/opensuse13/mit-krb5.pc
@@ -0,0 +1,7 @@
+Name: mit-krb5
+Description: An implementation of Kerberos network authentication
+Version: 1.12.2
+Cflags: 
+Libs: -lkrb5 -lk5crypto -lcom_err
+Libs.private: -lkrb5support
+
diff --git a/pkgconfig-workarounds/rh5/krb5-gssapi.pc b/pkgconfig-workarounds/rh5/krb5-gssapi.pc
new file mode 100644
index 0000000..617f021
--- /dev/null
+++ b/pkgconfig-workarounds/rh5/krb5-gssapi.pc
@@ -0,0 +1,7 @@
+vendor=MIT
+
+Name: krb5-gssapi
+Description: Kerberos implementation of the GSSAPI
+Version: 1.6.1
+Requires: mit-krb5-gssapi
+
diff --git a/pkgconfig-workarounds/rh5/krb5.pc b/pkgconfig-workarounds/rh5/krb5.pc
new file mode 100644
index 0000000..cf8a6b1
--- /dev/null
+++ b/pkgconfig-workarounds/rh5/krb5.pc
@@ -0,0 +1,7 @@
+vendor=MIT
+
+Name: krb5
+Description: An implementation of Kerberos network authentication
+Version: 1.6.1
+Requires: mit-krb5
+
diff --git a/pkgconfig-workarounds/rh5/mit-krb5-gssapi.pc b/pkgconfig-workarounds/rh5/mit-krb5-gssapi.pc
new file mode 100644
index 0000000..6a32fbb
--- /dev/null
+++ b/pkgconfig-workarounds/rh5/mit-krb5-gssapi.pc
@@ -0,0 +1,7 @@
+Name: mit-krb5-gssapi
+Description: Kerberos implementation of the GSSAPI
+Version: 1.6.1
+Requires.private: mit-krb5
+Cflags:
+Libs: -lgssapi_krb5
+
diff --git a/pkgconfig-workarounds/rh5/mit-krb5.pc b/pkgconfig-workarounds/rh5/mit-krb5.pc
new file mode 100644
index 0000000..e551510
--- /dev/null
+++ b/pkgconfig-workarounds/rh5/mit-krb5.pc
@@ -0,0 +1,7 @@
+Name: mit-krb5
+Description: An implementation of Kerberos network authentication
+Version: 1.6.1
+Cflags: 
+Libs: -lkrb5 -lk5crypto -lcom_err
+Libs.private: -lkrb5support
+
diff --git a/pkgconfig-workarounds/rh6/krb5-gssapi.pc b/pkgconfig-workarounds/rh6/krb5-gssapi.pc
new file mode 100644
index 0000000..8a58e0e
--- /dev/null
+++ b/pkgconfig-workarounds/rh6/krb5-gssapi.pc
@@ -0,0 +1,7 @@
+vendor=MIT
+
+Name: krb5-gssapi
+Description: Kerberos implementation of the GSSAPI
+Version: 1.10.3
+Requires: mit-krb5-gssapi
+
diff --git a/pkgconfig-workarounds/rh6/krb5.pc b/pkgconfig-workarounds/rh6/krb5.pc
new file mode 100644
index 0000000..d015bba
--- /dev/null
+++ b/pkgconfig-workarounds/rh6/krb5.pc
@@ -0,0 +1,7 @@
+vendor=MIT
+
+Name: krb5
+Description: An implementation of Kerberos network authentication
+Version: 1.10.3
+Requires: mit-krb5
+
diff --git a/pkgconfig-workarounds/rh6/mit-krb5-gssapi.pc b/pkgconfig-workarounds/rh6/mit-krb5-gssapi.pc
new file mode 100644
index 0000000..a4db5ca
--- /dev/null
+++ b/pkgconfig-workarounds/rh6/mit-krb5-gssapi.pc
@@ -0,0 +1,7 @@
+Name: mit-krb5-gssapi
+Description: Kerberos implementation of the GSSAPI
+Version: 1.10.3
+Requires.private: mit-krb5
+Cflags:
+Libs: -lgssapi_krb5
+
diff --git a/pkgconfig-workarounds/rh6/mit-krb5.pc b/pkgconfig-workarounds/rh6/mit-krb5.pc
new file mode 100644
index 0000000..99b0e17
--- /dev/null
+++ b/pkgconfig-workarounds/rh6/mit-krb5.pc
@@ -0,0 +1,7 @@
+Name: mit-krb5
+Description: An implementation of Kerberos network authentication
+Version: 1.10.3
+Cflags: 
+Libs: -lkrb5 -lk5crypto -lcom_err
+Libs.private: -lkrb5support
+
diff --git a/resolver.spec.in b/resolver.spec.in
index 6e74752..ba9cafe 100644
--- a/resolver.spec.in
+++ b/resolver.spec.in
@@ -8,20 +8,15 @@ License:	Apache-2.0
 URL:		http://shibboleth.net/
 Source0:	http://shibboleth.net/downloads/extensions/sp/%{name}-%{version}.tar.gz
 BuildRoot:	%{_tmppath}/%{name}-%{version}-root
-%if 0%{?suse_version} > 1030 && 0%{?suse_version} < 1130
-BuildRequires:  libxerces-c-devel >= 3.1
-%else
-%if 0%{?rhel} >= 7 || 0%{?centos_version} >= 700
-BuildRequires:  xerces-c-devel >= 3.1
-%else
-BuildRequires:  libxerces-c-devel >= 3.1
-%endif
-%endif
-BuildRequires:  libxml-security-c-devel >= 1.7.3
+BuildRequires:  libxerces-c-devel >= 3.2
+BuildRequires:  libxml-security-c-devel >= 2.0.0
+BuildRequires:  libxmltooling-devel >= 3.0.0
+BuildRequires:  libsaml-devel >= 3.0.0
+BuildRequires:  shibboleth-devel >= 3.0.0
 %{?_with_log4cpp:BuildRequires: liblog4cpp-devel >= 1.0}
 %{!?_with_log4cpp:BuildRequires: liblog4shib-devel >= 1.0.4}
 %{!?_without_gssapi:BuildRequires: krb5-devel}
-BuildRequires:  gcc-c++, libxmltooling-devel, libsaml-devel, shibboleth-devel
+BuildRequires:  gcc-c++, pkgconfig
 %if "%{_vendor}" == "redhat"
 BuildRequires: redhat-rpm-config
 %endif
@@ -37,13 +32,13 @@ This package contains a Shibboleth SP Extension that provides
 externally accessible attribute resolver functionality for processing
 local and remote sources of federated attribute information.
 
-%package -n libshibresolver1
+%package -n libshibresolver2
 Summary:    Shibboleth SP Attribute Resolver library
 Group:      Development/Libraries
 Provides:   @PACKAGE_NAME@ = %{version}-%{release}
 Obsoletes:  @PACKAGE_NAME@ < %{version}-%{release}
 
-%description -n libshibresolver1
+%description -n libshibresolver2
 This package contains a Shibboleth SP Extension that provides
 externally accessible attribute resolver functionality for processing
 local and remote sources of federated attribute information.
@@ -53,16 +48,13 @@ This package contains just the shared library.
 %package -n libshibresolver-devel
 Summary:    Shibboleth SP Attribute Resolver development Headers
 Group:      Development/Libraries
-Requires:   libshibresolver1 = %{version}-%{release}
+Requires:   libshibresolver2 = %{version}-%{release}
 Provides:   @PACKAGE_NAME at -devel = %{version}-%{release}
 Obsoletes:  @PACKAGE_NAME at -devel < %{version}-%{release}
-%if 0%{?rhel} >= 7 || 0%{?centos_version} >= 700
-Requires:   xerces-c-devel >= 3.1
-%else
-Requires:   libxerces-c-devel >= 3.1
-%endif
-Requires:   libxml-security-c-devel >= 1.7.3
-Requires: libxmltooling-devel, libsaml-devel, shibboleth-devel
+Requires: libxerces-c-devel >= 3.2
+Requires: libxml-security-c-devel >= 2.0.0
+Requires: libxmltooling-devel >= 3.0.0
+Requires: shibboleth-devel >= 3.0.0
 %{?_with_log4cpp:Requires: liblog4cpp-devel >= 1.0}
 %{!?_with_log4cpp:Requires: liblog4shib-devel >= 1.0.4}
 
@@ -77,7 +69,27 @@ This package includes files needed for development.
 %setup -q
 
 %build
-%configure --with-gssapi %{?shib_options}
+%if 0%{?suse_version} >= 1300
+    %configure --with-gssapi %{?shib_options} PKG_CONFIG_PATH=./pkgconfig-workarounds/opensuse13
+%else
+%if 0%{?suse_version} >= 1210
+    %configure --with-gssapi %{?shib_options}
+%else
+%if 0%{?rhel} >= 7 || 0%{?centos_version} >= 700
+    %configure --with-gssapi %{?shib_options} PKG_CONFIG_PATH=/opt/shibboleth/%{_lib}/pkgconfig
+%else
+%if 0%{?centos_version} >= 600 || 0%{?rhel} >= 6
+    %configure --with-gssapi %{?shib_options} PKG_CONFIG_PATH=/opt/shibboleth/%{_lib}/pkgconfig:./pkgconfig-workarounds/rh6
+%else
+%if 0%{?rhel} >= 5
+    %configure --with-gssapi %{?shib_options} PKG_CONFIG_PATH=./pkgconfig-workarounds/rh5
+%else
+    %configure --with-gssapi %{?shib_options}
+%endif
+%endif
+%endif
+%endif
+%endif
 %{__make} pkgdocdir=%{pkgdocdir}
 
 %install
@@ -91,14 +103,14 @@ This package includes files needed for development.
 [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
 
 %ifnos solaris2.8 solaris2.9 solaris2.10
-%post -n libshibresolver1 -p /sbin/ldconfig
+%post -n libshibresolver2 -p /sbin/ldconfig
 %endif
 
 %ifnos solaris2.8 solaris2.9 solaris2.10
-%postun -n libshibresolver1 -p /sbin/ldconfig
+%postun -n libshibresolver2 -p /sbin/ldconfig
 %endif
 
-%files -n libshibresolver1
+%files -n libshibresolver2
 %defattr(-,root,root,-)
 %{_libdir}/libshibresolver-lite.so.*
 %{_libdir}/libshibresolver.so.*
@@ -107,9 +119,13 @@ This package includes files needed for development.
 %defattr(-,root,root,-)
 %{_includedir}/*
 %{_libdir}/*.so
+%exclude %{_libdir}/*.la
 %doc %{pkgdocdir}
 
 %changelog
+* Fri Jul 20 2018  Scott Cantor  <cantor.2 at osu.edu>  - 3.0.0-1
+- Redo package for SP 3 release
+
 * Wed Jan 25 2017  Scott Cantor  <cantor.2 at osu.edu>  - 1.0.0-2
 - Apply fixes to make this available via official package sets
 
diff --git a/shibresolver-lite.pc.in b/shibresolver-lite.pc.in
new file mode 100644
index 0000000..7de0dc2
--- /dev/null
+++ b/shibresolver-lite.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: Shibboleth Attribute Resolver library
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lshibresolver-lite
+Libs.private: @PTHREAD_LIBS@
+Cflags: -I${includedir} @PTHREAD_CFLAGS@
+Requires: @SHIBRESOLVER_LITE_REQUIRES@
+Requires.private: @SHIBRESOLVER_LITE_REQUIRES_PRIVATE@
diff --git a/shibresolver.pc.in b/shibresolver.pc.in
new file mode 100644
index 0000000..d06617f
--- /dev/null
+++ b/shibresolver.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: Shibboleth Attribute Resolver library
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lshibresolver
+Libs.private: @PTHREAD_LIBS@
+Cflags: -I${includedir} @PTHREAD_CFLAGS@
+Requires: @SHIBRESOLVER_REQUIRES@ @SHIBRESOLVER_LITE_REQUIRES@
+Requires.private: @SHIBRESOLVER_REQUIRES_PRIVATE@ @SHIBRESOLVER_LITE_REQUIRES_PRIVATE@
diff --git a/src/Makefile.am b/src/Makefile.am
index f266c31..7699b22 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,12 +23,41 @@ libshibresolver_lite_la_SOURCES = \
 
 # this is different from the project version
 # http://sources.redhat.com/autobook/autobook/autobook_91.html
-libshibresolver_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0
-libshibresolver_lite_la_LDFLAGS = $(LITE_LIBS) -version-info 1:0:0
-libshibresolver_lite_la_CPPFLAGS = -DSHIBSP_LITE
+libshibresolver_la_LDFLAGS = -version-info 2:0:0
+libshibresolver_la_CXXFLAGS = \
+    $(PTHREAD_CFLAGS) \
+    $(gss_CFLAGS) $(gnu_gss_CFLAGS) \
+    $(log4shib_CFLAGS) $(log4cpp_CFLAGS) \
+    $(shibsp_CFLAGS) \
+    $(opensaml_CFLAGS) \
+    $(xerces_CFLAGS) \
+    $(xmlsec_CFLAGS) \
+    $(xmltooling_CFLAGS)
+libshibresolver_la_LIBADD = \
+    $(PTHREAD_LIBS) \
+    $(gss_LIBS) $(gnu_gss_LIBS) \
+    $(log4shib_LIBS) $(log4cpp_LIBS) \
+    $(shibsp_LIBS) \
+    $(opensaml_LIBS) \
+    $(xerces_LIBS) \
+    $(xmlsec_LIBS) \
+    $(xmltooling_LIBS)
 
-install-exec-hook:
-	for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done
+libshibresolver_lite_la_LDFLAGS = -version-info 2:0:0
+libshibresolver_lite_la_CPPFLAGS = -DSHIBSP_LITE \
+    $(PTHREAD_CFLAGS) \
+    $(gss_CFLAGS) $(gnu_gss_CFLAGS) \
+    $(log4shib_CFLAGS) $(log4cpp_CFLAGS) \
+    $(shibsp_lite_CFLAGS) \
+    $(xerces_CFLAGS) \
+    $(xmltooling_lite_CFLAGS)
+libshibresolver_lite_la_LIBADD = \
+    $(PTHREAD_LIBS) \
+    $(gss_LIBS) $(gnu_gss_LIBS) \
+    $(log4shib_LIBS) $(log4cpp_LIBS) \
+    $(shibsp_lite_LIBS) \
+    $(xerces_LIBS) \
+    $(xmltooling_lite_LIBS)
 
 EXTRA_DIST = \
 	resolver.vcxproj \
diff --git a/src/shibresolver/resolver.cpp b/src/shibresolver/resolver.cpp
index d3cf1e7..97664e7 100644
--- a/src/shibresolver/resolver.cpp
+++ b/src/shibresolver/resolver.cpp
@@ -120,9 +120,9 @@ ShibbolethResolver* ShibbolethResolver::create()
     return new ShibbolethResolver();
 }
 
-ShibbolethResolver::ShibbolethResolver() : m_request(NULL), m_sp(NULL)
+ShibbolethResolver::ShibbolethResolver() : m_request(nullptr), m_sp(nullptr)
 #ifdef SHIBRESOLVER_HAVE_GSSAPI
-        ,m_gsswrapper(NULL)
+        ,m_gsswrapper(nullptr)
 #endif
 {
 }
@@ -191,7 +191,7 @@ void ShibbolethResolver::addToken(gss_ctx_id_t* ctx)
 {
     if (m_gsswrapper) {
         delete m_gsswrapper;
-        m_gsswrapper = NULL;
+        m_gsswrapper = nullptr;
     }
 
     if (ctx && *ctx != GSS_C_NO_CONTEXT) {
@@ -226,7 +226,7 @@ void ShibbolethResolver::addToken(gss_name_t name)
 {
     if (m_gsswrapper) {
         delete m_gsswrapper;
-        m_gsswrapper = NULL;
+        m_gsswrapper = nullptr;
     }
 
     OM_uint32 minor;
@@ -246,7 +246,7 @@ void ShibbolethResolver::addToken(const gss_buffer_t contextbuf)
 {
     if (m_gsswrapper) {
         delete m_gsswrapper;
-        m_gsswrapper = NULL;
+        m_gsswrapper = nullptr;
     }
 
     XMLSize_t len=0;
@@ -331,7 +331,7 @@ void ShibbolethResolver::resolve()
             for (vector<const XMLObject*>::const_iterator t = m_tokens.begin(); t != m_tokens.end(); ++t) {
                 ostringstream os;
                 os << *(*t);
-                tokens.add(DDF(NULL).string(os.str().c_str()));
+                tokens.add(DDF(nullptr).string(os.str().c_str()));
             }
         }
         if (!m_inputAttributes.empty()) {
@@ -370,14 +370,14 @@ void RemotedResolver::receive(DDF& in, ostream& out)
 
     // Find application.
     const char* aid = in["application_id"].string();
-    const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL;
+    const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : nullptr;
     if (!app) {
         // Something's horribly wrong.
         log.error("couldn't find application (%s) for resolution", aid ? aid : "(missing)");
         throw ConfigurationException("Unable to locate application for resolution, deleted?");
     }
 
-    DDF ret(NULL);
+    DDF ret(nullptr);
     DDFJanitor jout(ret);
 
     Transaction t;
@@ -436,7 +436,7 @@ void RemotedResolver::resolve(
     MetadataProvider* m = app.getMetadataProvider(false);
     Locker locker(m);
 
-    const RoleDescriptor* role = NULL;
+    const RoleDescriptor* role = nullptr;
     if (issuer && *issuer)
         role = lookup(app, m, issuer, protocol);
 
@@ -451,15 +451,15 @@ void RemotedResolver::resolve(
             if (mprefix.first) {
                 log.debug("extracting metadata-derived attributes...");
                 try {
-                    // We pass NULL for "issuer" because the issuer isn't the one asserting metadata-based attributes.
-                    extractor->extractAttributes(app, NULL, *role, resolvedAttrs);
+                    // We pass nullptr for "issuer" because the issuer isn't the one asserting metadata-based attributes.
+                    extractor->extractAttributes(app, nullptr, nullptr, *role, resolvedAttrs);
                     for (vector<Attribute*>::iterator a = resolvedAttrs.begin(); a != resolvedAttrs.end(); ++a) {
                         vector<string>& ids = (*a)->getAliases();
                         for (vector<string>::iterator id = ids.begin(); id != ids.end(); ++id)
                             *id = mprefix.second + *id;
                     }
                 }
-                catch (exception& ex) {
+                catch (const exception& ex) {
                     log.error("caught exception extracting attributes: %s", ex.what());
                 }
             }
@@ -469,12 +469,12 @@ void RemotedResolver::resolve(
         const RoleDescriptor* role2;
         for (vector<const XMLObject*>::const_iterator t = tokens.begin(); t != tokens.end(); ++t) {
             // Save off any assertions for later use by resolver.
-            role2 = NULL;
+            role2 = nullptr;
             const Assertion* assertion = dynamic_cast<const Assertion*>(*t);
             if (assertion) {
                 assertions.push_back(assertion);
                 const saml2::Assertion* saml2token = dynamic_cast<const saml2::Assertion*>(assertion);
-                if (saml2token && saml2token->getIssuer() && (saml2token->getIssuer()->getFormat() == NULL ||
+                if (saml2token && saml2token->getIssuer() && (saml2token->getIssuer()->getFormat() == nullptr ||
                         XMLString::equals(saml2token->getIssuer()->getFormat(), saml2::NameID::ENTITY))) {
                     auto_ptr_char tokenissuer(saml2token->getIssuer()->getName());
                     role2 = lookup(app, m, tokenissuer.get(), protocol);
@@ -499,11 +499,12 @@ void RemotedResolver::resolve(
             auto_ptr<ResolutionContext> ctx(
                 resolver->createResolutionContext(
                     app,
-                    role ? dynamic_cast<const EntityDescriptor*>(role->getParent()) : NULL,
+                    nullptr,
+                    role ? dynamic_cast<const EntityDescriptor*>(role->getParent()) : nullptr,
                     protocol ? protocol : samlconstants::SAML20P_NS,
-                    NULL,
-                    NULL,
-                    NULL,
+                    nullptr,
+                    nullptr,
+                    nullptr,
                     &assertions,
                     &inputs
                     )
@@ -515,7 +516,7 @@ void RemotedResolver::resolve(
             }
         }
     }
-    catch (exception& ex) {
+    catch (const exception& ex) {
         log.error("attribute resolution failed: %s", ex.what());
     }
 #else
@@ -535,9 +536,9 @@ void RemotedResolver::resolve(
 {
     vector<Attribute*> extractedAttrs;
     try {
-        extractor->extractAttributes(app, issuer, token, extractedAttrs);
+        extractor->extractAttributes(app, nullptr, issuer, token, extractedAttrs);
     }
-    catch (exception& ex) {
+    catch (const exception& ex) {
         Category::getInstance(SHIBRESOLVER_LOGCAT).error("caught exception extracting attributes: %s", ex.what());
     }
 
@@ -548,7 +549,7 @@ void RemotedResolver::resolve(
         try {
             filter->filterAttributes(fc, extractedAttrs);
         }
-        catch (exception& ex) {
+        catch (const exception& ex) {
             Category::getInstance(SHIBRESOLVER_LOGCAT).error("caught exception filtering attributes: %s", ex.what());
             Category::getInstance(SHIBRESOLVER_LOGCAT).error("dumping extracted attributes due to filtering exception");
             for_each(extractedAttrs.begin(), extractedAttrs.end(), xmltooling::cleanup<shibsp::Attribute>());
@@ -564,7 +565,7 @@ const RoleDescriptor* RemotedResolver::lookup(
     ) const
 {
     if (!m)
-        return NULL;
+        return nullptr;
 
     MetadataProviderCriteria idpmc(app, entityID, &IDPSSODescriptor::ELEMENT_QNAME, protocol ? protocol : samlconstants::SAML20P_NS);
     if (protocol)
@@ -641,11 +642,9 @@ void ShibbolethResolver::term()
 
 extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*)
 {
-#ifdef SHIBRESOLVER_SHIBSP_HAS_REMOTING
     SPConfig& conf = SPConfig::getConfig();
     if (conf.isEnabled(SPConfig::OutOfProcess) && !conf.isEnabled(SPConfig::InProcess) && conf.isEnabled(SPConfig::Listener))
         conf.getServiceProvider()->regListener("org.project-moonshot.shibresolver", &g_Remoted);
-#endif
     return 0;   // signal success
 }
 
diff --git a/src/shibresolver/resolver.h b/src/shibresolver/resolver.h
index d6b7a87..c3f5317 100644
--- a/src/shibresolver/resolver.h
+++ b/src/shibresolver/resolver.h
@@ -179,7 +179,7 @@ namespace shibresolver {
 #else
             unsigned long features = shibsp::SPConfig::OutOfProcess,
 #endif
-            const char* config = NULL,
+            const char* config = nullptr,
             bool rethrow = false
             );
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list