]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Add configure flags to moderate the ClueCon nags
authorTravis Cross <tc@traviscross.com>
Sat, 22 Sep 2012 19:05:18 +0000 (19:05 +0000)
committerTravis Cross <tc@traviscross.com>
Sun, 23 Sep 2012 07:49:26 +0000 (07:49 +0000)
The default remains the same: we show the huge ClueCon nag banner on
startup and in fs_cli.

However, if you pass --disable-huge-cluecon-nag, no banner will be
shown.

If you pass --enable-modest-cluecon-nag, a modest text-based ClueCon
reminder will be shown instead.

Makefile.am
build/Makefile.am
configure.in
libs/esl/fs_cli.c
libs/esl/src/include/cc.h
src/include/cc.h
src/switch_core.c

index e7f1f799a57fc263d1f1c24fcdd85ab5a77bcf6f..cdf20f55c02e8fcb5121b833c162d9e8b6624b3c 100644 (file)
@@ -311,7 +311,7 @@ bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode
 ##
 fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
        libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c
-fs_cli_CFLAGS  = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include 
+fs_cli_CFLAGS  = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include -include src/include/switch_private.h
 fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm
 
 if HAVE_LIBEDIT
@@ -660,13 +660,15 @@ sofia-reconf:
        cd libs/sofia-sip && ./configure --prefix=$(prefix) --with-pic --with-glib=no --disable-shared
 
 cluecon:
-       @clear
-       @echo Thank you for updating. This is going to take a while so relax.
-       @echo Now would be a good time to register for ClueCon!
-       @cat cluecon2.tmpl
-       @echo
-       @echo http://www.cluecon.com
-       @sleep 5
+       @if $(ENABLE_CLUECON_NAG); then \
+         clear; \
+         echo "Thank you for updating. This is going to take a while so relax."; \
+         echo "Now would be a good time to register for ClueCon!"; \
+         cat cluecon2.tmpl; \
+         echo; \
+         echo "http://www.cluecon.com"; \
+         sleep 5; \
+       fi
 current: cluecon update-clean is-scm
        $(MAKE) update
        $(MAKE) all
index 3feb22157d8c9907e2f5003445473296bb3a3c09..fa5a257a5fa45206a1c51905a1de00d4627c5a8f 100644 (file)
@@ -11,7 +11,7 @@ all:
        @echo " + http://www.cluecon.com                        +"
        @echo " +                                               +"
        @echo " +-----------------------------------------------+"
-       @cat ../cluecon2.tmpl
+       @-$(ENABLE_CLUECON_NAG) && cat ../cluecon2.tmpl
 
 install:
        @echo " +---------- FreeSWITCH install Complete ----------+"
@@ -69,7 +69,7 @@ install:
        @echo " +       http://www.cluecon.com                    +"
        @echo " +                                                 +"
        @echo " +-------------------------------------------------+"
-       @cat ../cluecon2.tmpl
+       @-$(ENABLE_CLUECON_NAG) && cat ../cluecon2.tmpl
 
 
 .PHONY: check dvi html info install-data \
index 5a97b86ace865e3e36ab260765b67347108d6702..926706ed78f72f83adf33afbc9372904d52c066d 100644 (file)
@@ -330,6 +330,26 @@ if test "x${enable_visibility}" != "xno" ; then
        fi
 fi
 
+# Enable ClueCon nag banner (default: on)
+AC_ARG_ENABLE(huge-cluecon-nag,
+[AC_HELP_STRING([--disable-huge-cluecon-nag],[build without huge ClueCon banners])],
+[enable_huge_cluecon_nag="$enableval"],[enable_huge_cluecon_nag="yes"])
+
+AC_ARG_ENABLE(modest-cluecon-nag,
+[AC_HELP_STRING([--enable-modest-cluecon-nag],[build with modest ClueCon announcements])],
+[enable_modest_cluecon_nag="$enableval"],[enable_modest_cluecon_nag="no"])
+
+if test "${enable_modest_cluecon_nag}" = "yes"; then
+   enable_huge_cluecon_nag="no"
+   AC_DEFINE([SHOW_MODEST_CLUECON_NAG],[1],[Show modest ClueCon nag messages.])
+   AC_SUBST([ENABLE_CLUECON_NAG],[false])
+elif test "${enable_huge_cluecon_nag}" = "yes"; then
+   AC_DEFINE([SHOW_HUGE_CLUECON_NAG],[1],[Show huge ClueCon nag messages.])
+   AC_SUBST([ENABLE_CLUECON_NAG],[true])
+else
+   AC_SUBST([ENABLE_CLUECON_NAG],[false])
+fi
+
 # Enable debugging (default: on)
 # (rename option if the default is changed)
 AC_ARG_ENABLE(debug,
@@ -1115,7 +1135,7 @@ AC_OUTPUT
 ##
 ## Registering for ClueCon
 ##
-if ! test -f noreg ; then
+if ! test -f noreg && test "${enable_huge_cluecon_nag}" = "yes" ; then
 echo ""
 echo ""
 echo $ECHO_N "Registering you for ClueCon http://www.cluecon.com $ECHO_C" 1>&6
index 95629da76e3eeb75e129de890c61f1cbdfdbbe0c..03d8e351d142a3f1fc3f540e89afe8462543eaf0 100644 (file)
@@ -931,17 +931,17 @@ static void print_banner(FILE *stream)
        WriteFile(hStdout, banner, (DWORD) strlen(banner), NULL, NULL);
        WriteFile(hStdout, cc, (DWORD) strlen(cc), NULL, NULL);
        SetConsoleTextAttribute(hStdout, wOldColorAttrs);
-
        /* Print the rest info in default colors */
        fprintf(stream, "\n%s\n", inf);
-#else
-       fprintf(stream,
-                       "%s%s%s%s%s%s\n%s\n", 
+#elif SHOW_HUGE_CLUECON_NAG
+       fprintf(stream, "%s%s%s%s%s%s\n%s\n",
                        ESL_SEQ_DEFAULT_COLOR,
                        ESL_SEQ_FYELLOW, ESL_SEQ_BBLUE,
                        banner,
                        cc, ESL_SEQ_DEFAULT_COLOR, inf);
-
+       fprintf(stream, "%s", output_text_color);
+#else
+       fprintf(stream, "%s%s%s\n%s\n", ESL_SEQ_DEFAULT_COLOR, banner, cc, inf);
        fprintf(stream, "%s", output_text_color);
 #endif
 }
index 44666193c615e0a9f6ae398e4c690b20b6feeac0..6387209c6b886e2a9a2259a0dd72a0155858cb6b 100644 (file)
@@ -1,2 +1,8 @@
+#ifdef SHOW_HUGE_CLUECON_NAG
 const char *cc = ".========================================================================================================.\n|    ____                       _____        ____ _             ____              _ _ _____              |\n|   / ___|___  _ __ ___   ___  |_   _|__    / ___| |_   _  ___ / ___|___  _ __   ( ) |___ /              |\n|  | |   / _ \\| '_ ` _ \\ / _ \\   | |/ _ \\  | |   | | | | |/ _ \\ |   / _ \\| '_ \\  |/| | |_ \\              |\n|  | |__| (_) | | | | | |  __/   | | (_) | | |___| | |_| |  __/ |__| (_) | | | |   | |___) |             |\n|   \\____\\___/|_| |_| |_|\\___|   |_|\\___/   \\____|_|\\__,_|\\___|\\____\\___/|_| |_|   |_|____/              |\n|                                                                                                        |\n|    ____ _     _                          _   _ ____    _                                               |\n|   / ___| |__ (_) ___ __ _  __ _  ___    | | | / ___|  / \\                                              |\n|  | |   | '_ \\| |/ __/ _` |/ _` |/ _ \\   | | | \\___ \\ / _ \\                                             |\n|  | |___| | | | | (_| (_| | (_| | (_) |  | |_| |___) / ___ \\                                            |\n|   \\____|_| |_|_|\\___\\__,_|\\__, |\\___( )  \\___/|____/_/   \\_\\                                           |\n|                           |___/     |/                                                                 |\n|      _                         _      __   _   _                ___  _   _       ____   ___  _ _____   |\n|     / \\  _   _  __ _ _   _ ___| |_   / /_ | |_| |__            ( _ )| |_| |__   |___ \\ / _ \\/ |___ /   |\n|    / _ \\| | | |/ _` | | | / __| __| | '_ \\| __| '_ \\   _____   / _ \\| __| '_ \\    __) | | | | | |_ \\   |\n|   / ___ \\ |_| | (_| | |_| \\__ \\ |_  | (_) | |_| | | | |_____| | (_) | |_| | | |  / __/| |_| | |___) |  |\n|  /_/   \\_\\__,_|\\__, |\\__,_|___/\\__|  \\___/ \\__|_| |_|          \\___/ \\__|_| |_| |_____|\\___/|_|____/   |\n|                |___/                                                                                   |\n|                                           _                                                            |\n|  __      ____      ____      __       ___| |_   _  ___  ___ ___  _ __         ___ ___  _ __ ___        |\n|  \\ \\ /\\ / /\\ \\ /\\ / /\\ \\ /\\ / /      / __| | | | |/ _ \\/ __/ _ \\| '_ \\       / __/ _ \\| '_ ` _ \\       |\n|   \\ V  V /  \\ V  V /  \\ V  V /   _  | (__| | |_| |  __/ (_| (_) | | | |  _  | (_| (_) | | | | | |      |\n|    \\_/\\_/    \\_/\\_/    \\_/\\_/   (_)  \\___|_|\\__,_|\\___|\\___\\___/|_| |_| (_)  \\___\\___/|_| |_| |_|      |\n|                                                                                                        |\n.========================================================================================================.\n";
+#elif SHOW_MODEST_CLUECON_NAG
+const char *cc = "Come to ClueCon '13 August 6-8th, 2013, Chicago, USA\nwww.cluecon.com\n";
+#else
+const char *cc = "";
+#endif
 
index 44666193c615e0a9f6ae398e4c690b20b6feeac0..6387209c6b886e2a9a2259a0dd72a0155858cb6b 100644 (file)
@@ -1,2 +1,8 @@
+#ifdef SHOW_HUGE_CLUECON_NAG
 const char *cc = ".========================================================================================================.\n|    ____                       _____        ____ _             ____              _ _ _____              |\n|   / ___|___  _ __ ___   ___  |_   _|__    / ___| |_   _  ___ / ___|___  _ __   ( ) |___ /              |\n|  | |   / _ \\| '_ ` _ \\ / _ \\   | |/ _ \\  | |   | | | | |/ _ \\ |   / _ \\| '_ \\  |/| | |_ \\              |\n|  | |__| (_) | | | | | |  __/   | | (_) | | |___| | |_| |  __/ |__| (_) | | | |   | |___) |             |\n|   \\____\\___/|_| |_| |_|\\___|   |_|\\___/   \\____|_|\\__,_|\\___|\\____\\___/|_| |_|   |_|____/              |\n|                                                                                                        |\n|    ____ _     _                          _   _ ____    _                                               |\n|   / ___| |__ (_) ___ __ _  __ _  ___    | | | / ___|  / \\                                              |\n|  | |   | '_ \\| |/ __/ _` |/ _` |/ _ \\   | | | \\___ \\ / _ \\                                             |\n|  | |___| | | | | (_| (_| | (_| | (_) |  | |_| |___) / ___ \\                                            |\n|   \\____|_| |_|_|\\___\\__,_|\\__, |\\___( )  \\___/|____/_/   \\_\\                                           |\n|                           |___/     |/                                                                 |\n|      _                         _      __   _   _                ___  _   _       ____   ___  _ _____   |\n|     / \\  _   _  __ _ _   _ ___| |_   / /_ | |_| |__            ( _ )| |_| |__   |___ \\ / _ \\/ |___ /   |\n|    / _ \\| | | |/ _` | | | / __| __| | '_ \\| __| '_ \\   _____   / _ \\| __| '_ \\    __) | | | | | |_ \\   |\n|   / ___ \\ |_| | (_| | |_| \\__ \\ |_  | (_) | |_| | | | |_____| | (_) | |_| | | |  / __/| |_| | |___) |  |\n|  /_/   \\_\\__,_|\\__, |\\__,_|___/\\__|  \\___/ \\__|_| |_|          \\___/ \\__|_| |_| |_____|\\___/|_|____/   |\n|                |___/                                                                                   |\n|                                           _                                                            |\n|  __      ____      ____      __       ___| |_   _  ___  ___ ___  _ __         ___ ___  _ __ ___        |\n|  \\ \\ /\\ / /\\ \\ /\\ / /\\ \\ /\\ / /      / __| | | | |/ _ \\/ __/ _ \\| '_ \\       / __/ _ \\| '_ ` _ \\       |\n|   \\ V  V /  \\ V  V /  \\ V  V /   _  | (__| | |_| |  __/ (_| (_) | | | |  _  | (_| (_) | | | | | |      |\n|    \\_/\\_/    \\_/\\_/    \\_/\\_/   (_)  \\___|_|\\__,_|\\___|\\___\\___/|_| |_| (_)  \\___\\___/|_| |_| |_|      |\n|                                                                                                        |\n.========================================================================================================.\n";
+#elif SHOW_MODEST_CLUECON_NAG
+const char *cc = "Come to ClueCon '13 August 6-8th, 2013, Chicago, USA\nwww.cluecon.com\n";
+#else
+const char *cc = "";
+#endif
 
index ec313ea2fb4a81da8a7d2b1f29bae007ef32c9fa..27e17179167d00c61995325eec91cc4914d472cf 100644 (file)
@@ -2002,12 +2002,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
 
 #ifdef WIN32
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s%s\n\n", switch_core_banner(), cc);
-#else
+#elif SHOW_HUGE_CLUECON_NAG
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s%s%s%s%s%s\n\n", 
                                          SWITCH_SEQ_DEFAULT_COLOR,
                                          SWITCH_SEQ_FYELLOW, SWITCH_SEQ_BBLUE,
                                          switch_core_banner(), 
                                          cc, SWITCH_SEQ_DEFAULT_COLOR);
+#else
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s%s%s\n\n",
+                                         SWITCH_SEQ_DEFAULT_COLOR,
+                                         switch_core_banner(), cc);
 #endif