Patch to find apr config from branch.
[shibboleth/sp.git] / configure.ac
index 93387b0..517e55c 100644 (file)
@@ -177,6 +177,27 @@ 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"
+else
+    if test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
+        XMLTOOLINGXMLDIR="$with_xerces"
+    else
+        if test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
+            XMLTOOLINGXMLDIR="$with_log4shib"
+        fi
+    fi
+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,
@@ -241,6 +262,32 @@ opensaml::SAMLConfig::getConfig();
 # 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"
+else
+    if test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
+        OPENSAMLXMLDIR="$with_xmltooling"
+    else
+        if test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
+            OPENSAMLXMLDIR="$with_xerces"
+        else
+            if test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
+                OPENSAMLXMLDIR="$with_log4shib"
+            fi
+        fi
+    fi
+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)
 
@@ -533,7 +580,7 @@ if test "$WANT_APACHE_20" = "yes" ; then
         fi
         ],
         [
-        AC_PATH_PROG(APR_CONFIG, apr-config)
+        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`"
@@ -624,7 +671,7 @@ if test "$WANT_APACHE_22" = "yes" ; then
         fi
         ],
         [
-        AC_PATH_PROG(APR1_CONFIG, apr-1-config)
+        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`"