trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1057703 - in /trafficserver/traffic/trunk: ./ build/ lib/ts/ proxy/mgmt2/cli/ proxy/mgmt2/cluster/ proxy/mgmt2/cop/ proxy/mgmt2/web2/
Date Tue, 11 Jan 2011 15:49:42 GMT
Author: amc
Date: Tue Jan 11 15:49:41 2011
New Revision: 1057703

URL: http://svn.apache.org/viewvc?rev=1057703&view=rev
Log:
TS-583

Modified:
    trafficserver/traffic/trunk/build/common.m4
    trafficserver/traffic/trunk/configure.ac
    trafficserver/traffic/trunk/lib/ts/ink_config.h.in
    trafficserver/traffic/trunk/proxy/mgmt2/cli/CLImonitor.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc
    trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc
    trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc
    trafficserver/traffic/trunk/proxy/mgmt2/web2/WebIntrMain.cc
    trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc

Modified: trafficserver/traffic/trunk/build/common.m4
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/build/common.m4?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/build/common.m4 (original)
+++ trafficserver/traffic/trunk/build/common.m4 Tue Jan 11 15:49:41 2011
@@ -546,3 +546,34 @@ do
     fi
 done
 ])
+
+dnl
+dnl Support macro for AC_ARG_ENABLE
+dnl Arguments:
+dnl 1: Variable prefix
+dnl 2: Variable stem
+dnl The prefix is prepended with separating underscore to the stem
+dnl to create the boolean variable to be set. The stem is also used
+dnl to create the name of the AC_ARG_ENABLE variable and therefore
+dnl must be the same as passed to AC_ARG_ENABLE. The prefix should
+dnl be one of "use", "has", or "is", as is appropriate for the
+dnl argument type. The target variable will be set to '1' if the
+dnl enable argument is 'yes', and '0' otherwise.
+dnl
+dnl For instance, if the prefix is "has" and stem is "bob",
+dnl then AC_ARG_ENABLE will set $enable_bob and this macro will set
+dnl $has_bob based on the value in $enable_bob. See the examples of
+dnl use later in this file.
+dnl
+dnl Note: As with AC_ARG_ENABLE, non-alphabetic characters are
+dnl transformed to underscores.
+dnl
+AC_DEFUN([TS_ARG_ENABLE_VAR],[
+  ts_local_prefix="AS_TR_SH($1)"
+  ts_local_stem="AS_TR_SH($2)"
+  AS_VAR_IF([enable_${ts_local_stem}], [yes],
+    [AS_VAR_SET([${ts_local_prefix}_${ts_local_stem}], 1)],
+    [AS_VAR_SET([${ts_local_prefix}_${ts_local_stem}], 0)]
+  )
+])
+

Modified: trafficserver/traffic/trunk/configure.ac
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/configure.ac?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/configure.ac (original)
+++ trafficserver/traffic/trunk/configure.ac Tue Jan 11 15:49:41 2011
@@ -153,46 +153,42 @@ AC_MSG_RESULT([$enable_debug])
 # Diags
 #
 
-use_diags=0
 AC_MSG_CHECKING([whether to enable diags])
 AC_ARG_ENABLE([diags],
   [AS_HELP_STRING([--disable-diags],[turn off diags])],
   [],
-  [enable_diags="yes"
-   use_diags=1
-  ]
+  [enable_diags=yes]
 )
 AC_MSG_RESULT([$enable_diags])
+TS_ARG_ENABLE_VAR([use], [diags])
 AC_SUBST(use_diags)
 
 #
 # Build regression tests?
 #
 
-has_tests=0
 AC_MSG_CHECKING([whether to enable regression tests])
 AC_ARG_ENABLE([tests],
   [AS_HELP_STRING([--disable-tests],[turn off regression tests])],
   [],
-  [enable_tests="yes"
-   has_tests=1
-  ]
+  [enable_tests=yes]
 )
 AC_MSG_RESULT([$enable_tests])
+TS_ARG_ENABLE_VAR([has], [tests])
 AC_SUBST(has_tests)
-AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_tests" = "xyes"])
+AM_CONDITIONAL([BUILD_TESTS], [test 0 -ne $has_tests])
 
 #
 # Purify
 #
-has_purify=0
 AC_MSG_CHECKING([whether to enable purify])
 AC_ARG_ENABLE([purify],
   [AS_HELP_STRING([--enable-purify],[enable support for Purify])],
-  [has_purify=1],
+  [],
   [enable_purify=no]
 )
 AC_MSG_RESULT([$enable_purify])
+TS_ARG_ENABLE_VAR([has], [purify])
 AC_SUBST(has_purify)
 
 #
@@ -207,33 +203,32 @@ AC_ARG_ENABLE([libev],
 )
 AC_MSG_RESULT([$enable_libev])
 
-
 #
 # Micro
 #
-is_micro_build=0
 AC_MSG_CHECKING([whether to enable micro-TS])
 AC_ARG_ENABLE([micro],
   [AS_HELP_STRING([--enable-micro],[enable micro-TS build [default: no]])],
-  [is_micro_build=1],
+  [],
   [enable_micro=no]
 )
+AS_IF([test "x$enable_micro" = "xyes"], [is_micro_build=1], [is_micro_build=0])
 AC_SUBST(is_micro_build)
 AC_MSG_RESULT([$enable_micro])
 
 #
 # Standalone iocore
 #
-has_standalone_iocore=0
 AC_MSG_CHECKING([whether to build a standalone iocore])
 AC_ARG_ENABLE([standalone-iocore],
   [AS_HELP_STRING([--enable-standalone-iocore],[build just standalone iocore])],
-  [has_standalone_iocore=1],
+  [],
   [enable_standalone_iocore=no]
 )
 AC_MSG_RESULT([$enable_standalone_iocore])
+TS_ARG_ENABLE_VAR([has],[standalone-iocore])
 AC_SUBST(has_standalone_iocore)
-AS_IF([test "x$enable_standalone_iocore" = "xyes"],
+AS_IF([test $has_standalone_iocore],
   [AC_SUBST([IOCORE_MODULARIZED_DEFS],[""])
    AC_SUBST([ink_with_modules_def],["-DREC_BUILD_STAND_ALONE"])
    AC_SUBST([ink_with_modules_local],[""])
@@ -245,7 +240,7 @@ AS_IF([test "x$enable_standalone_iocore"
    AC_SUBST([ink_with_modules_process],["-DPROCESS_MANAGER"])
   ]
 )
-AM_CONDITIONAL([STANDALONE_IOCORE], [test "x$enable_standalone_iocore" = "xyes"])
+AM_CONDITIONAL([STANDALONE_IOCORE], [test 0 -ne $has_standalone_iocore])
 
 #
 # Remote Coverity Prevent commit
@@ -262,56 +257,56 @@ AC_SUBST([enable_remote_cov_commit])
 #
 # WebUI
 #
-has_webui=0
 AC_MSG_CHECKING([whether to enable Web UI])
 AC_ARG_ENABLE([webui],
   [AS_HELP_STRING([--enable-webui],[enable Web UI [default: no]])],
-  [has_webui=1],
+  [],
   [enable_webui=no]
 )
+TS_ARG_ENABLE_VAR([has],[webui])
 AC_MSG_RESULT([$enable_webui])
 AC_SUBST(has_webui)
-AM_CONDITIONAL([BUILD_WEBUI], [test "x$enable_webui" = "xyes"])
+AM_CONDITIONAL([BUILD_WEBUI], [test 0 -ne $has_webui])
 
 #
 # API
 #
-has_inkapi=1
 AC_MSG_CHECKING([whether to enable API and plugin support])
 AC_ARG_ENABLE([api],
   [AS_HELP_STRING([--disable-api],[do not enable API and plugin support])],
-  [has_inkapi=0],
+  [],
   [enable_api=yes]
 )
 AC_MSG_RESULT([$enable_api])
+AS_IF([test "x$enable_api" = "xyes"], [has_inkapi=1], [has_inkapi=0])
 AC_SUBST(has_inkapi)
 
 #
 # Detailed Logging (for debugging purposes)
 #
-has_detailed_log=0
 AC_MSG_CHECKING([whether to enable detailed logging for debugging purposes])
 AC_ARG_ENABLE([detailed-log],
   [AS_HELP_STRING([--enable-detailed-log],[enable detailed logging])],
-  [has_detailed_log=1],
+  [],
   [enable_detailed_log=no]
 )
 AC_MSG_RESULT([$enable_detailed_log])
+TS_ARG_ENABLE_VAR([has],[detailed-log])
 AC_SUBST(has_detailed_log)
 AM_CONDITIONAL([BUILD_DETAILED_LOG], [test "x$enable_detailed_log" = "xyes"])
 
 #
 # Cli2
 #
-has_cli2=1
 AC_MSG_CHECKING([whether to enable cli2])
 AC_ARG_ENABLE([cli2],
   [AS_HELP_STRING([--disable-cli2],[do not compile cli2])],
-  [has_cli2=0],
+  [],
   [enable_cli2=yes]
 )
 AC_MSG_RESULT([$enable_cli2])
-AS_IF([test "x$enable_cli2" = "xyes"],
+TS_ARG_ENABLE_VAR([has],[cli2])
+AS_IF([test $has_cli2],
   [AC_SUBST([CLI_DIR],[cli2])]
 )
 AC_SUBST(has_cli2)
@@ -319,7 +314,6 @@ AC_SUBST(has_cli2)
 #
 # Experimental V2 stats APIs (for plugins)
 #
-has_v2stats=0
 AC_MSG_CHECKING([whether to enable the experimental V2 stats subsystem for plugin APIs])
 AC_ARG_ENABLE([v2stats],
   [AS_HELP_STRING([--enable-v2stats],[enable experimental V2 stats API])],
@@ -327,24 +321,23 @@ AC_ARG_ENABLE([v2stats],
   [enable_v2stats=no]
 )
 AC_MSG_RESULT([$enable_v2stats])
+TS_ARG_ENABLE_VAR([has],[v2stats])
 AC_SUBST(has_v2stats)
-AM_CONDITIONAL([BUILD_V2STATS], [test "x$enable_v2stats" = "xyes"])
+AM_CONDITIONAL([BUILD_V2STATS], [test 0 -ne $has_v2stats])
 
 #
 # WCCP
 #
-has_wccp=0
 AC_MSG_CHECKING([whether to enable WCCP v2 support])
 AC_ARG_ENABLE([wccp],
   [AS_HELP_STRING([--enable-wccp],[enable WCCP v2])],
-  [
-    has_wccp=1
-  ],
+  [],
   [enable_wccp=no]
 )
 AC_MSG_RESULT([$enable_wccp])
+TS_ARG_ENABLE_VAR([has],[wccp])
 AC_SUBST(has_wccp)
-AM_CONDITIONAL([BUILD_WCCP], [test "x$enable_wccp" = "xyes"])
+AM_CONDITIONAL([BUILD_WCCP], [test 0 -ne $has_wccp])
 
 # Google profiler
 AC_MSG_CHECKING([whether to enable profiler])

Modified: trafficserver/traffic/trunk/lib/ts/ink_config.h.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_config.h.in?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_config.h.in (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_config.h.in Tue Jan 11 15:49:41 2011
@@ -165,10 +165,6 @@
 # define HTTP_CACHE                     1
 #endif
 
-#if !TS_HAS_WEBUI
-# define NO_WEBUI                       1
-#endif
-
 #if TS_HAS_PURIFY
 # define PURIFY                         1
 #endif

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli/CLImonitor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli/CLImonitor.cc?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli/CLImonitor.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli/CLImonitor.cc Tue Jan 11 15:49:41 2011
@@ -730,7 +730,7 @@ CLI_monitor::doMonitorDashboard(CLI_DATA
     c_data->output->copyFrom(line2, strlen(line2));
     c_data->output->copyFrom(CLI_globals::sep1, strlen(CLI_globals::sep1));
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
     // show dashboard
     overviewGenerator->generateTableCLI(c_data->output);
 #endif

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc Tue Jan 11 15:49:41 2011
@@ -1200,7 +1200,7 @@ ClusterCom::handleMultiCastFilePacket(ch
             delete our_rec_cfg;
             delete our_locals_ht;
           }
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
           if (!file_update_failure)
             WebHttpTreeRebuildJsTree();
 #endif

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc Tue Jan 11 15:49:41 2011
@@ -1230,7 +1230,7 @@ test_server_http_port()
   return test_http_port(http_backdoor_port, request, server_timeout * 1000, ip, ip);
 }
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
 static int
 test_manager_http_port()
 {
@@ -1269,7 +1269,7 @@ heartbeat_manager()
 #endif
     return err;
   }
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   err = test_manager_http_port();
 
   if (err < 0) {
@@ -1291,7 +1291,7 @@ heartbeat_manager()
     manager_failures = 0;
   }
 
-#endif //NO_WEBUI
+#endif // TS_HAS_WEBUI
 
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Leaving heartbeat_manager() --> %d\n", err);

Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc Tue Jan 11 15:49:41 2011
@@ -2072,7 +2072,7 @@ handle_submit_snapshot_to_floppy(WebHttp
         linkFile = "/configure/c_basic.ink";
       }
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
       char *link = WebHttpGetLink_Xmalloc(linkFile);
       whc->response_hdr->setRefreshURL(link);
       xfree(link);
@@ -2467,7 +2467,7 @@ handle_submit_update(WebHttpContext * wh
   }
   // check for restart
   if (ink_hash_table_lookup(whc->post_data_ht, "restart", (void **) &cancel)) {
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
     char *link = WebHttpGetLink_Xmalloc(HTML_DEFAULT_CONFIGURE_FILE);
     whc->response_hdr->setRefreshURL(link);
     xfree(link);
@@ -2573,7 +2573,7 @@ handle_submit_update(WebHttpContext * wh
     submit_from_page = xstrdup("/ssl_redirect.ink");
   }
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   if (submit_from_page && strcmp(submit_from_page, HTML_FEATURE_ON_OFF_FILE) == 0)
{
     WebHttpTreeRebuildJsTree();
   }
@@ -3202,7 +3202,7 @@ handle_submit_otw_upgrade(WebHttpContext
   char *working_dir;
   char *submit_from_page;
   char tmp[MAX_TMP_BUF_LEN];
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   char *link;
 #endif
   const char *cgi_path;
@@ -3233,7 +3233,7 @@ handle_submit_otw_upgrade(WebHttpContext
 
     } else {
       // start upgrade = render upgrade page + spawn traffic_shell.cgi script
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
       link = WebHttpGetLink_Xmalloc(HTML_DEFAULT_MONITOR_FILE);
       xfree(link);
 #endif
@@ -3725,7 +3725,7 @@ WebHttpInit()
   WebHttpAuthInit();
   WebHttpLogInit();
   WebHttpSessionInit();
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   WebHttpRenderInit();
   WebHttpTreeInit();
 #endif
@@ -3791,7 +3791,7 @@ WebHttpHandleConnection(WebHttpConInfo *
       goto Ltransaction_send;
     }
   } else {
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
     if (WebHttpTreeReturnRefresh(file)) {
       // if we are handling a monitor/mrtg page, configure it to refresh
       if (strncmp(file, "/monitor/", 9) == 0) {

Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc Tue Jan 11 15:49:41 2011
@@ -122,7 +122,7 @@ WebHttpGetIntFromQuery(WebHttpContext * 
   }
 }
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
 //-------------------------------------------------------------------------
 // handle_alarm_object
 //-------------------------------------------------------------------------

Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebIntrMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebIntrMain.cc?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebIntrMain.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebIntrMain.cc Tue Jan 11 15:49:41 2011
@@ -597,7 +597,7 @@ webIntr_main(void *x)
   sigset_t allSigs;             // Set of all signals
 #endif
   char *cliPath = NULL;         // UNIX: socket path for cli
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   char webFailMsg[] = "Management Web Services Failed to Initialize";
 #endif
   char pacFailMsg[] = "Auto-Configuration Service Failed to Initialize";
@@ -612,7 +612,7 @@ webIntr_main(void *x)
 
   int addrLen;
   int i;
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   int sleepTime = 2;
 #endif
   // No Warning
@@ -721,7 +721,7 @@ webIntr_main(void *x)
 
   adminContext.SSL_Context = NULL;
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   // configure components
   configAuthEnabled();
   configAuthAdminUser();
@@ -730,7 +730,7 @@ webIntr_main(void *x)
   // <@record> substitution requires WebHttpInit() first
   // configLangDict();
   configUI();
-#endif /* NO_WEBUI */
+#endif /* TS_HAS_WEBUI */
 
   configSSLenable();
   Debug("ui", "SSL enabled is %d\n", adminContext.SSLenabled);
@@ -854,7 +854,7 @@ webIntr_main(void *x)
   // Check our web contexts to make sure everything is
   //  OK.  If it is, go ahead and fire up the interfaces
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
 
   if (checkWebContext(&adminContext, "Web Management") != 0) {
     lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_WEB_ERROR, webFailMsg);
@@ -876,7 +876,7 @@ webIntr_main(void *x)
     }
   }
 
-#endif //NO_WEBUI
+#endif //TS_HAS_WEBUI
 
   if (checkWebContext(&autoconfContext, "Browser Auto-Configuration") != 0) {
     lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_WEB_ERROR, pacFailMsg);
@@ -918,9 +918,9 @@ webIntr_main(void *x)
 
   // Initialze WebHttp Module
   WebHttpInit();
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
   configLangDict();
-#endif /* NO_WEBUI */
+#endif /* TS_HAS_WEBUI */
 
   while (1) {
 
@@ -1008,12 +1008,12 @@ webIntr_main(void *x)
       // Accept OK
       ink_mutex_acquire(&wGlobals.serviceThrLock);
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
       // Check to see if there are any unprocessed config changes
       if (webConfigChanged > 0) {
         updateWebConfig();
       }
-#endif /* NO_WEBUI */
+#endif /* TS_HAS_WEBUI */
 
       // If this a web manager or an overseer connection, make sure that
       //   it is from an allowed ip addr

Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc?rev=1057703&r1=1057702&r2=1057703&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc Tue Jan 11 15:49:41 2011
@@ -901,7 +901,7 @@ overviewPage::generateAlarmsTableCLI(tex
   ink_mutex_release(&accessLock);
 }                               // end generateAlarmsTableCLI()
 
-#ifndef NO_WEBUI
+#if TS_HAS_WEBUI
 // void overviewPage::generateAlarmsSummary(textBuffer* output)
 //
 //  alarm summary information (Alarm! [X pending])



Mime
View raw message