[asterisk-addons-commits] tilghman: trunk r455 - in /trunk: ./ format_mp3/

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Tue Oct 2 13:07:39 CDT 2007


Author: tilghman
Date: Tue Oct  2 13:07:37 2007
New Revision: 455

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=455
Log:
Add dev-mode to addons (closes issue #10864)

Added:
    trunk/Makefile.rules   (with props)
Modified:
    trunk/Makefile
    trunk/configure
    trunk/configure.ac
    trunk/format_mp3/Makefile
    trunk/makeopts.in

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk-addons/trunk/Makefile?view=diff&rev=455&r1=454&r2=455
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue Oct  2 13:07:37 2007
@@ -9,6 +9,8 @@
 # the GNU General Public License
 #
 
+export NOISY_BUILD
+
 .EXPORT_ALL_VARIABLES:
 
 .PHONY: all install depend samples clean update distclean dist-clean menuselect chan_ooh323.so format_mp3.so
@@ -17,6 +19,12 @@
 OVERWRITE:=y
 
 CFLAGS+=-fPIC
+
+#NOISY_BUILD=yes
+
+ifeq ($(AST_DEVMODE),yes)
+  CFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT)
+endif
 
 # If the file .asteriskaddons.makeopts is present in your home directory, you can
 # include all of your favorite menuselect options so that every time you download
@@ -102,7 +110,7 @@
 	@echo " +               $(MAKE) samples                    +"
 	@echo " +-----------------------------------------------+"
 
-dist-clean: distclean
+#dist-clean: distclean
 
 distclean: clean
 	@$(MAKE) -C menuselect distclean
@@ -196,3 +204,6 @@
 
 menuselect/menuselect: menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h config.status
 	@CFLAGS="" $(MAKE) -C menuselect
+
+include Makefile.rules
+

Added: trunk/Makefile.rules
URL: http://svn.digium.com/view/asterisk-addons/trunk/Makefile.rules?view=auto&rev=455
==============================================================================
--- trunk/Makefile.rules (added)
+++ trunk/Makefile.rules Tue Oct  2 13:07:37 2007
@@ -1,0 +1,113 @@
+#
+# Asterisk -- A telephony toolkit for Linux.
+# 
+# Makefile rules
+#
+# Copyright (C) 2006, Digium, Inc.
+#
+# Kevin P. Fleming <kpfleming at digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+# Each command is preceded by a short comment on what to do.
+# Prefixing one or the other with @\# or @ or nothing makes the desired
+# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
+
+-include $(ASTTOPDIR)/makeopts
+
+.PHONY: dist-clean
+
+ifeq ($(NOISY_BUILD),)
+   ECHO_PREFIX=@
+   CMD_PREFIX=@
+else
+   ECHO_PREFIX=@\# 
+   CMD_PREFIX=
+endif
+
+ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
+# More GSM codec optimization
+# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
+# which support MMX instructions.  This should be newer pentiums,
+# ppro's, etc, as well as the AMD K6 and K7.  
+#K6OPT=-DK6OPT
+
+OPTIMIZE?=-O6
+ASTCFLAGS+=$(OPTIMIZE)
+endif
+
+%.o: %.c
+	$(ECHO_PREFIX) echo "   [CC] $< -> $@"
+ifeq ($(AST_DEVMODE),yes)
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
+else
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS)
+endif
+
+%.o: %.i
+	$(ECHO_PREFIX) echo "   [CC] $< -> $@"
+ifeq ($(AST_DEVMODE),yes)
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
+else
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS)
+endif
+
+%.i: %.c
+	$(ECHO_PREFIX) echo "   [CC] $< -> $@"
+ifeq ($(AST_DEVMODE),yes)
+	$(CMD_PREFIX) $(CC) -o $@ -E $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
+else
+	$(CMD_PREFIX) $(CC) -o $@ -E $< $(PTHREAD_CFLAGS) $(ASTCFLAGS)
+endif
+
+%.o: %.s
+	$(ECHO_PREFIX) echo "   [AS] $< -> $@"
+ifeq ($(AST_DEVMODE),yes)
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
+else
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS)
+endif
+
+%.oo: %.cc
+	$(ECHO_PREFIX) echo "   [CXX] $< -> $@"
+ifeq ($(AST_DEVMODE),yes)
+	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$(ASTCFLAGS)) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
+else
+	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$(ASTCFLAGS))
+endif
+
+%.c: %.y
+	$(ECHO_PREFIX) echo "   [BISON] $< -> $@"
+	$(CMD_PREFIX) bison -o $@ -d --name-prefix=ast_yy $<
+
+%.c: %.fl
+	$(ECHO_PREFIX) echo "   [FLEX] $< -> $@"
+	$(CMD_PREFIX) flex -o $@ --full $<
+
+%.so: %.o
+	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
+	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $^ $(PTHREAD_LIBS) $(LIBS)
+
+%.so: %.oo
+	$(ECHO_PREFIX) echo "   [LDXX] $^ -> $@"
+	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $^ $(PTHREAD_LIBS) $(LIBS)
+
+%.eo: %.o
+	$(ECHO_PREFIX) echo "   [EMBED] $< -> $@"
+	$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_eo_script $* > .$@.ld
+	$(CMD_PREFIX) $(LD) -r -T .$@.ld -o $@ $<
+	$(CMD_PREFIX) rm -f .$@.ld
+
+%.eoo: %.o
+	$(ECHO_PREFIX) echo "   [EMBED] $< -> $@"
+	$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_eo_script $* > .$@.ld
+	$(CMD_PREFIX) $(LD) -r -T .$@.ld -o $@ $<
+	$(CMD_PREFIX) rm -f .$@.ld
+
+%: %.o
+	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
+	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $^ $(PTHREAD_LIBS) $(LIBS)
+
+dist-clean::

Propchange: trunk/Makefile.rules
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/Makefile.rules
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Propchange: trunk/Makefile.rules
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: trunk/configure
URL: http://svn.digium.com/view/asterisk-addons/trunk/configure?view=diff&rev=455&r1=454&r2=455
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Tue Oct  2 13:07:37 2007
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 383 .
+# From configure.ac Revision: 384 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -698,6 +698,7 @@
 BASENAME
 DIRNAME
 LN
+AST_DEVMODE
 BLUETOOTH_LIB
 BLUETOOTH_INCLUDE
 PBX_BLUETOOTH
@@ -715,6 +716,7 @@
 PBX_ASTERISK
 CPP
 EGREP
+AST_DECLARATION_AFTER_STATEMENT
 MYSQL_CONFIG
 LIBOBJS
 LTLIBOBJS'
@@ -1300,6 +1302,11 @@
 if test -n "$ac_init_help"; then
 
   cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-dev-mode    Turn on developer mode
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -4455,6 +4462,19 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+# Check whether --enable-dev-mode was given.
+if test "${enable_dev_mode+set}" = set; then
+  enableval=$enable_dev_mode; case "${enableval}" in
+              y|ye|yes) AST_DEVMODE=yes ;;
+              n|no)  AST_DEVMODE=no ;;
+              *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-dev-mode" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-dev-mode" >&2;}
+   { (exit 1); exit 1; }; }  ;;
+        esac
+fi
+
+
+
 # from here on down, library checking should be done in alphabetical order
 # by the --with option name, to make things easier for the users :-)
 
@@ -6415,6 +6435,20 @@
       exit 1
    fi
 fi
+
+
+{ echo "$as_me:$LINENO: checking for -Wdeclaration-after-statement support" >&5
+echo $ECHO_N "checking for -Wdeclaration-after-statement support... $ECHO_C" >&6; }
+if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
+else
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        AST_DECLARATION_AFTER_STATEMENT=
+fi
+
 
 
 MYSQL_CONFIG=No
@@ -7539,6 +7573,7 @@
 BASENAME!$BASENAME$ac_delim
 DIRNAME!$DIRNAME$ac_delim
 LN!$LN$ac_delim
+AST_DEVMODE!$AST_DEVMODE$ac_delim
 BLUETOOTH_LIB!$BLUETOOTH_LIB$ac_delim
 BLUETOOTH_INCLUDE!$BLUETOOTH_INCLUDE$ac_delim
 PBX_BLUETOOTH!$PBX_BLUETOOTH$ac_delim
@@ -7554,7 +7589,6 @@
 ASTERISK_LIB!$ASTERISK_LIB$ac_delim
 ASTERISK_INCLUDE!$ASTERISK_INCLUDE$ac_delim
 PBX_ASTERISK!$PBX_ASTERISK$ac_delim
-CPP!$CPP$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -7596,13 +7630,15 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+CPP!$CPP$ac_delim
 EGREP!$EGREP$ac_delim
+AST_DECLARATION_AFTER_STATEMENT!$AST_DECLARATION_AFTER_STATEMENT$ac_delim
 MYSQL_CONFIG!$MYSQL_CONFIG$ac_delim
 LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 4; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk-addons/trunk/configure.ac?view=diff&rev=455&r1=454&r2=455
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Oct  2 13:07:37 2007
@@ -156,6 +156,15 @@
 
 AC_LANG(C)
 
+AC_ARG_ENABLE(dev-mode,
+        [  --enable-dev-mode    Turn on developer mode],
+        [case "${enableval}" in
+              y|ye|yes) AST_DEVMODE=yes ;;
+              n|no)  AST_DEVMODE=no ;;
+              *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
+        esac])
+AC_SUBST(AST_DEVMODE)
+
 # from here on down, library checking should be done in alphabetical order
 # by the --with option name, to make things easier for the users :-)
 
@@ -168,6 +177,17 @@
 AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h])
 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
+
+AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
+if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+        AC_MSG_RESULT(yes)
+        AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
+else
+        AC_MSG_RESULT(no)
+        AST_DECLARATION_AFTER_STATEMENT=
+fi
+AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
+
 
 MYSQL_CONFIG=No
 PBX_MYSQLCLIENT=0

Modified: trunk/format_mp3/Makefile
URL: http://svn.digium.com/view/asterisk-addons/trunk/format_mp3/Makefile?view=diff&rev=455&r1=454&r2=455
==============================================================================
--- trunk/format_mp3/Makefile (original)
+++ trunk/format_mp3/Makefile Tue Oct  2 13:07:37 2007
@@ -77,3 +77,5 @@
 	asterisk -rx "unload format_mp3.so"
 	$(INSTALL) -m 755 format_mp3.so $(DESTDIR)$(MODULES_DIR)
 	asterisk -rx "load format_mp3.so"
+
+include ../Makefile.rules

Modified: trunk/makeopts.in
URL: http://svn.digium.com/view/asterisk-addons/trunk/makeopts.in?view=diff&rev=455&r1=454&r2=455
==============================================================================
--- trunk/makeopts.in (original)
+++ trunk/makeopts.in Tue Oct  2 13:07:37 2007
@@ -33,6 +33,9 @@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 
+AST_DEVMODE=@AST_DEVMODE@
+AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
+
 BLUETOOTH_LIB=@BLUETOOTH_LIB@
 BLUETOOTH_INCLUDE=@BLUETOOTH_INCLUDE@
 




More information about the asterisk-addons-commits mailing list