Bring consistency to config options

The configuration options that exist in bmcweb are an amalgimation of
CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms
and meson options using a config file.  This history has led to a lot of
different ways to configure code in the codebase itself, which has led
to problems, and issues in consistency.

ifdef options do no compile time checking of code not within the branch.
This is good when you have optional dependencies, but not great when
you're trying to ensure both options compile.

This commit moves all internal configuration options to:
1. A namespace called bmcweb
2. A naming scheme matching the meson option.  hyphens are replaced with
   underscores, and the option is uppercased.  This consistent transform
   allows matching up option keys with their code counterparts, without
   naming changes.
3. All options are bool true = enabled, and any options with _ENABLED or
   _DISABLED postfixes have those postfixes removed.  (note, there are
   still some options with disable in the name, those are left as-is)
4. All options are now constexpr booleans, without an explicit compare.

To accomplish this, unfortunately an option list in config/meson.build
is required, given that meson doesn't provide a way to dump all options,
as is a manual entry in bmcweb_config.h.in, in addition to the
meson_options.  This obsoletes the map in the main meson.build, which
helps some of the complexity.

Now that we've done this, we have some rules that will be documented.
1. Runtime behavior changes should be added as a constexpr bool to
   bmcweb_config.h
2. Options that require optionally pulling in a dependency shall use an
   ifdef, defined in the primary meson.build.  (note, there are no
   options that currently meet this class, but it's included for
   completeness.)

Note, that this consolidation means that at configure time, all options
are printed.  This is a good thing and allows direct comparison of
configs in log files.

Tested: Code compiles
Server boots, and shows options configured in the default build. (HTTPS,
log level, etc)

Change-Id: I94e79a56bcdc01755036e4e7278c7e69e25809ce
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/src/webserver_run.cpp b/src/webserver_run.cpp
index 81a78cc..8088596 100644
--- a/src/webserver_run.cpp
+++ b/src/webserver_run.cpp
@@ -37,64 +37,67 @@
     // Static assets need to be initialized before Authorization, because auth
     // needs to build the whitelist from the static routes
 
-#ifdef BMCWEB_ENABLE_STATIC_HOSTING
-    crow::webassets::requestRoutes(app);
-#endif
+    if constexpr (BMCWEB_STATIC_HOSTING)
+    {
+        crow::webassets::requestRoutes(app);
+    }
 
-#ifdef BMCWEB_ENABLE_KVM
-    crow::obmc_kvm::requestRoutes(app);
-#endif
+    if constexpr (BMCWEB_KVM)
+    {
+        crow::obmc_kvm::requestRoutes(app);
+    }
 
-#ifdef BMCWEB_ENABLE_REDFISH
-    redfish::RedfishService redfish(app);
+    if constexpr (BMCWEB_REDFISH)
+    {
+        redfish::RedfishService redfish(app);
 
-    // Create EventServiceManager instance and initialize Config
-    redfish::EventServiceManager::getInstance(&*io);
+        // Create EventServiceManager instance and initialize Config
+        redfish::EventServiceManager::getInstance(&*io);
 
-#ifdef BMCWEB_ENABLE_REDFISH_AGGREGATION
-    // Create RedfishAggregator instance and initialize Config
-    redfish::RedfishAggregator::getInstance(&*io);
-#endif
-#endif
+        if constexpr (BMCWEB_REDFISH_AGGREGATION)
+        {
+            // Create RedfishAggregator instance and initialize Config
+            redfish::RedfishAggregator::getInstance(&*io);
+        }
+    }
 
-#ifdef BMCWEB_ENABLE_DBUS_REST
-    crow::dbus_monitor::requestRoutes(app);
-    crow::image_upload::requestRoutes(app);
-    crow::openbmc_mapper::requestRoutes(app);
-#endif
+    if constexpr (BMCWEB_REST)
+    {
+        crow::dbus_monitor::requestRoutes(app);
+        crow::image_upload::requestRoutes(app);
+        crow::openbmc_mapper::requestRoutes(app);
+    }
 
-#ifdef BMCWEB_ENABLE_HOST_SERIAL_WEBSOCKET
-    crow::obmc_console::requestRoutes(app);
-#endif
+    if constexpr (BMCWEB_HOST_SERIAL_SOCKET)
+    {
+        crow::obmc_console::requestRoutes(app);
+    }
 
-#ifdef BMCWEB_ENABLE_VM_WEBSOCKET
     crow::obmc_vm::requestRoutes(app);
-#endif
 
-#ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE
-    crow::ibm_mc::requestRoutes(app);
-#endif
+    if constexpr (BMCWEB_IBM_MANAGEMENT_CONSOLE)
+    {
+        crow::ibm_mc::requestRoutes(app);
+    }
 
-#ifdef BMCWEB_ENABLE_GOOGLE_API
-    crow::google_api::requestRoutes(app);
-#endif
+    if constexpr (BMCWEB_GOOGLE_API)
+    {
+        crow::google_api::requestRoutes(app);
+    }
 
     crow::login_routes::requestRoutes(app);
 
-#ifdef BMCWEB_ENABLE_VM_NBDPROXY
-    crow::nbd_proxy::requestRoutes(app);
-#endif
-
-#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
-    int rc = redfish::EventServiceManager::startEventLogMonitor(*io);
-    if (rc != 0)
+    if constexpr (BMCWEB_REDFISH_DBUS_LOG)
     {
-        BMCWEB_LOG_ERROR("Redfish event handler setup failed...");
-        return rc;
+        int rc = redfish::EventServiceManager::startEventLogMonitor(*io);
+        if (rc != 0)
+        {
+            BMCWEB_LOG_ERROR("Redfish event handler setup failed...");
+            return rc;
+        }
     }
-#endif
 
-    if constexpr (bmcwebEnableTLS)
+    if constexpr (!BMCWEB_INSECURE_DISABLE_SSL)
     {
         BMCWEB_LOG_INFO("Start Hostname Monitor Service...");
         crow::hostname_monitor::registerHostnameSignal();