Skip to content

Commit fb2ffba

Browse files
committed
Add configure flags to moderate the ClueCon nags
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.
1 parent 53c24a9 commit fb2ffba

File tree

7 files changed

+55
-17
lines changed

7 files changed

+55
-17
lines changed

Makefile.am

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode
311311
##
312312
fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
313313
libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c
314-
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
314+
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include -include src/include/switch_private.h
315315
fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm
316316

317317
if HAVE_LIBEDIT
@@ -660,13 +660,15 @@ sofia-reconf:
660660
cd libs/sofia-sip && ./configure --prefix=$(prefix) --with-pic --with-glib=no --disable-shared
661661

662662
cluecon:
663-
@clear
664-
@echo Thank you for updating. This is going to take a while so relax.
665-
@echo Now would be a good time to register for ClueCon!
666-
@cat cluecon2.tmpl
667-
@echo
668-
@echo http://www.cluecon.com
669-
@sleep 5
663+
@if $(ENABLE_CLUECON_NAG); then \
664+
clear; \
665+
echo "Thank you for updating. This is going to take a while so relax."; \
666+
echo "Now would be a good time to register for ClueCon!"; \
667+
cat cluecon2.tmpl; \
668+
echo; \
669+
echo "http://www.cluecon.com"; \
670+
sleep 5; \
671+
fi
670672
current: cluecon update-clean is-scm
671673
$(MAKE) update
672674
$(MAKE) all

build/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ all:
1111
@echo " + http://www.cluecon.com +"
1212
@echo " + +"
1313
@echo " +-----------------------------------------------+"
14-
@cat ../cluecon2.tmpl
14+
@-$(ENABLE_CLUECON_NAG) && cat ../cluecon2.tmpl
1515

1616
install:
1717
@echo " +---------- FreeSWITCH install Complete ----------+"
@@ -69,7 +69,7 @@ install:
6969
@echo " + http://www.cluecon.com +"
7070
@echo " + +"
7171
@echo " +-------------------------------------------------+"
72-
@cat ../cluecon2.tmpl
72+
@-$(ENABLE_CLUECON_NAG) && cat ../cluecon2.tmpl
7373

7474

7575
.PHONY: check dvi html info install-data \

configure.in

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,26 @@ if test "x${enable_visibility}" != "xno" ; then
330330
fi
331331
fi
332332

333+
# Enable ClueCon nag banner (default: on)
334+
AC_ARG_ENABLE(huge-cluecon-nag,
335+
[AC_HELP_STRING([--disable-huge-cluecon-nag],[build without huge ClueCon banners])],
336+
[enable_huge_cluecon_nag="$enableval"],[enable_huge_cluecon_nag="yes"])
337+
338+
AC_ARG_ENABLE(modest-cluecon-nag,
339+
[AC_HELP_STRING([--enable-modest-cluecon-nag],[build with modest ClueCon announcements])],
340+
[enable_modest_cluecon_nag="$enableval"],[enable_modest_cluecon_nag="no"])
341+
342+
if test "${enable_modest_cluecon_nag}" = "yes"; then
343+
enable_huge_cluecon_nag="no"
344+
AC_DEFINE([SHOW_MODEST_CLUECON_NAG],[1],[Show modest ClueCon nag messages.])
345+
AC_SUBST([ENABLE_CLUECON_NAG],[false])
346+
elif test "${enable_huge_cluecon_nag}" = "yes"; then
347+
AC_DEFINE([SHOW_HUGE_CLUECON_NAG],[1],[Show huge ClueCon nag messages.])
348+
AC_SUBST([ENABLE_CLUECON_NAG],[true])
349+
else
350+
AC_SUBST([ENABLE_CLUECON_NAG],[false])
351+
fi
352+
333353
# Enable debugging (default: on)
334354
# (rename option if the default is changed)
335355
AC_ARG_ENABLE(debug,
@@ -1115,7 +1135,7 @@ AC_OUTPUT
11151135
##
11161136
## Registering for ClueCon
11171137
##
1118-
if ! test -f noreg ; then
1138+
if ! test -f noreg && test "${enable_huge_cluecon_nag}" = "yes" ; then
11191139
echo ""
11201140
echo ""
11211141
echo $ECHO_N "Registering you for ClueCon http://www.cluecon.com $ECHO_C" 1>&6

libs/esl/fs_cli.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -931,17 +931,17 @@ static void print_banner(FILE *stream)
931931
WriteFile(hStdout, banner, (DWORD) strlen(banner), NULL, NULL);
932932
WriteFile(hStdout, cc, (DWORD) strlen(cc), NULL, NULL);
933933
SetConsoleTextAttribute(hStdout, wOldColorAttrs);
934-
935934
/* Print the rest info in default colors */
936935
fprintf(stream, "\n%s\n", inf);
937-
#else
938-
fprintf(stream,
939-
"%s%s%s%s%s%s\n%s\n",
936+
#elif SHOW_HUGE_CLUECON_NAG
937+
fprintf(stream, "%s%s%s%s%s%s\n%s\n",
940938
ESL_SEQ_DEFAULT_COLOR,
941939
ESL_SEQ_FYELLOW, ESL_SEQ_BBLUE,
942940
banner,
943941
cc, ESL_SEQ_DEFAULT_COLOR, inf);
944-
942+
fprintf(stream, "%s", output_text_color);
943+
#else
944+
fprintf(stream, "%s%s%s\n%s\n", ESL_SEQ_DEFAULT_COLOR, banner, cc, inf);
945945
fprintf(stream, "%s", output_text_color);
946946
#endif
947947
}

libs/esl/src/include/cc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
#ifdef SHOW_HUGE_CLUECON_NAG
12
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";
3+
#elif SHOW_MODEST_CLUECON_NAG
4+
const char *cc = "Come to ClueCon '13 August 6-8th, 2013, Chicago, USA\nwww.cluecon.com\n";
5+
#else
6+
const char *cc = "";
7+
#endif
28

src/include/cc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
#ifdef SHOW_HUGE_CLUECON_NAG
12
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";
3+
#elif SHOW_MODEST_CLUECON_NAG
4+
const char *cc = "Come to ClueCon '13 August 6-8th, 2013, Chicago, USA\nwww.cluecon.com\n";
5+
#else
6+
const char *cc = "";
7+
#endif
28

src/switch_core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2002,12 +2002,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
20022002

20032003
#ifdef WIN32
20042004
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s%s\n\n", switch_core_banner(), cc);
2005-
#else
2005+
#elif SHOW_HUGE_CLUECON_NAG
20062006
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s%s%s%s%s%s\n\n",
20072007
SWITCH_SEQ_DEFAULT_COLOR,
20082008
SWITCH_SEQ_FYELLOW, SWITCH_SEQ_BBLUE,
20092009
switch_core_banner(),
20102010
cc, SWITCH_SEQ_DEFAULT_COLOR);
2011+
#else
2012+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s%s%s\n\n",
2013+
SWITCH_SEQ_DEFAULT_COLOR,
2014+
switch_core_banner(), cc);
20112015
#endif
20122016

20132017

0 commit comments

Comments
 (0)