]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] better reporting of xml/json unavailability
authorEvan Hunt <each@isc.org>
Thu, 13 Aug 2015 04:58:04 +0000 (21:58 -0700)
committerEvan Hunt <each@isc.org>
Thu, 13 Aug 2015 04:58:04 +0000 (21:58 -0700)
- error if "configure --with-libxml2" but the library isn't available
- log a warning on startup if only JSON or only XML can be served

bin/named/statschannel.c
configure
configure.in

index 9ff6c585afb747d579c1d54cd6eae8c3437acb34..3c55304e09c6517a381180c49cdc0f68906ecf04 100644 (file)
@@ -2923,7 +2923,20 @@ ns_statschannels_configure(ns_server_t *server, const cfg_obj_t *config,
                              NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
                              "statistics-channels specified but not effective "
                              "due to missing XML and/or JSON library");
-#endif
+#else /* EXTENDED_STATS */
+#ifndef HAVE_LIBXML2
+               isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
+                             NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
+                             "statistics-channels: XML library missing, "
+                             "only JSON stats will be available");
+#endif /* !HAVE_LIBXML2 */
+#ifndef HAVE_JSON
+               isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
+                             NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
+                             "statistics-channels: JSON library missing, "
+                             "only XML stats will be available");
+#endif /* !HAVE_JSON */
+#endif /* EXTENDED_STATS */
 
                for (element = cfg_list_first(statschannellist);
                     element != NULL;
index 133a25611c29a0e7fe2bf78b592b38839fa2ccd5..8f5c0ba794b0b9ebc3ac9df7903e4034a0a9d9e1 100755 (executable)
--- a/configure
+++ b/configure
@@ -16482,8 +16482,14 @@ case "$use_libxml2" in
                        libxml2_cflags=`xml2-config --cflags`
                        ;;
                *)
-                       libxml2_libs=
-                       libxml2_cflags=
+                       if test "$use_libxml2" = "yes" ; then
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                               as_fn_error $? "required libxml2 version not available" "$LINENO" 5
+                       else
+                               libxml2_libs=
+                               libxml2_cflags=
+                       fi
                        ;;
                esac
                ;;
index f9f11d825110abaa43c0cb5fe74ce6ab6ba9d56d..aa1f05a94daf0f3c632519ca102aefc70f28f9bd 100644 (file)
@@ -2067,8 +2067,13 @@ case "$use_libxml2" in
                        libxml2_cflags=`xml2-config --cflags`
                        ;;
                *)
-                       libxml2_libs=
-                       libxml2_cflags=
+                       if test "$use_libxml2" = "yes" ; then
+                               AC_MSG_RESULT(no)
+                               AC_MSG_ERROR(required libxml2 version not available)
+                       else
+                               libxml2_libs=
+                               libxml2_cflags=
+                       fi
                        ;;
                esac
                ;;