[svn-commits] mjordan: testsuite/bamboo/trunk r4555 - /bamboo/trunk/bin/build-asterisk-only.sh

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jan 12 12:51:41 CST 2014


Author: mjordan
Date: Sun Jan 12 12:51:34 2014
New Revision: 4555

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4555
Log:
build-asterisk-only: Update to allow enabling/disabling of menuselect options

With the addition of res_mwi_external, we need to be able to enable/disable
voicemail menuselect options. This adds some command line parameters to the
script to toggle menuselect options, as well as the debug configure/make
options.

Modified:
    bamboo/trunk/bin/build-asterisk-only.sh

Modified: bamboo/trunk/bin/build-asterisk-only.sh
URL: http://svnview.digium.com/svn/testsuite/bamboo/trunk/bin/build-asterisk-only.sh?view=diff&rev=4555&r1=4554&r2=4555
==============================================================================
--- bamboo/trunk/bin/build-asterisk-only.sh (original)
+++ bamboo/trunk/bin/build-asterisk-only.sh Sun Jan 12 12:51:34 2014
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
 #
 # Builds the checked out version of Asterisk
 #
@@ -9,9 +9,45 @@
 #  - FreeBSD 8.0
 #
 
-PLAN=$1
+show_help()
+{
+	echo "build-asterisk-only: Build Asterisk"
+	echo "Options:"
+	echo "  -d: Add a DISABLE option to pass to menuselect"
+	echo "  -e: Add an ENABLE option to pass to menuselect"
+	echo "  -v: Enable dev-mode and other related configure options"
+}
+
+DEBUG=false
+ENABLES=""
+DISABLES=""
+
 PWD=`pwd`
 BUILDFLAGS="NOISY_BUILD=yes"
+
+OPTIND=1
+while getopts "h?d:e:v" opt; do
+	case "$opt" in
+	h|\?)
+		show_help
+		exit 0
+		;;
+	d)
+		DISABLES="$DISABLES $OPTARG"
+		;;
+	e)
+		ENABLES="$ENABLES $OPTARG"
+		;;
+	v)
+		DEBUG=true
+		;;
+	esac
+done
+shift $((OPTIND-1)) # Shift off the options and optional --
+
+echo $ENABLES
+IFS=' ' read -a ARR_ENABLES <<< "${ENABLES}"
+IFS=' ' read -a ARR_DISABLES <<< "$DISABLES"
 
 if which gmake ; then
 	MAKE=gmake
@@ -34,7 +70,10 @@
 
 # Run configure.  Note that if needed, this portion can
 # be expanded to provide more configure flags in the future
-COMMON_CONFIGURE_ARGS="--sysconfdir=/etc --enable-dev-mode --enable-coverage"
+COMMON_CONFIGURE_ARGS="--sysconfdir=/etc"
+if $DEBUG ; then
+	COMMON_CONFIGURE_ARGS="$COMMON_CONFIGURE_ARGS --enable-dev-mode --enable-coverage"
+fi
 ./configure ${COMMON_CONFIGURE_ARGS}
 
 # Test both 'uninstall' and 'uninstall-all', since they have different logic paths
@@ -43,13 +82,13 @@
 ${MAKE} ${BUILDFLAGS} uninstall-all
 ${MAKE} ${BUILDFLAGS} menuselect.makeopts
 
-menuselect/menuselect --enable DONT_OPTIMIZE menuselect.makeopts
-menuselect/menuselect --enable MALLOC_DEBUG menuselect.makeopts
-# menuselect/menuselect --enable DEBUG_THREADS menuselect.makeopts
-menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts
-# menuselect/menuselect --enable DETECT_DEADLOCKS menuselect.makeopts
-menuselect/menuselect --enable TEST_FRAMEWORK menuselect.makeopts
-menuselect/menuselect --enable-category MENUSELECT_TESTS menuselect.makeopts
+if $DEBUG ; then
+	menuselect/menuselect --enable DONT_OPTIMIZE menuselect.makeopts
+	menuselect/menuselect --enable MALLOC_DEBUG menuselect.makeopts
+	menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts
+	menuselect/menuselect --enable TEST_FRAMEWORK menuselect.makeopts
+	menuselect/menuselect --enable-category MENUSELECT_TESTS menuselect.makeopts
+fi
 if [ -d bridges ] ; then
 	menuselect/menuselect --enable-category MENUSELECT_BRIDGES menuselect.makeopts
 fi
@@ -76,11 +115,14 @@
 	menuselect/menuselect --enable-category MENUSELECT_UTILS menuselect.makeopts
 fi
 
-if [ "${PLAN}" = "AST-14" ] ; then
-	# If we're building Asterisk 1.4, let make run twice, and ignore failures
-	# the first time, because of the way the build of chan_h323 works in 1.4.
-	${MAKE} ${BUILDFLAGS} ASTCFLAGS=${ASTCFLAGS} || :
-fi
+for ((i=0; i<${#ARR_ENABLES[@]}; ++i)); do
+	menuselect/menuselect --enable "${ARR_ENABLES[$i]}" menuselect.makeopts
+done
+for ((i=0; i<${#ARR_DISABLES[@]}; ++i)); do
+	menuselect/menuselect --disable "${ARR_DISABLES[$i]}" menuselect.makeopts
+done
+
+
 ${MAKE} ${BUILDFLAGS} ASTCFLAGS=${ASTCFLAGS}
 
 if [ -f doc/core-en_US.xml ] ; then
@@ -96,16 +138,6 @@
 WGET_EXTRA_ARGS=--quiet ${MAKE} ${BUILDFLAGS} install
 ${MAKE} ${BUILDFLAGS} samples
 
-if [ $"{PLAN}" = "AST-14" ]; then
-	svn co http://svn.digium.com/svn/asterisk-addons/branches/1.4 addons
-	( cd addons ; ./configure ; ${MAKE} ${BUILDFLAGS} ; ${MAKE} ${BUILDFLAGS} install ; ${MAKE} ${BUILDFLAGS} samples )
-fi
-
-if [ $"{PLAN}" = "AST-162" ]; then
-	svn co http://svn.digium.com/svn/asterisk-addons/branches/1.6.2 addons
-	( cd addons ; ./configure ; ${MAKE} ${BUILDFLAGS} ; ${MAKE} ${BUILDFLAGS} install ; ${MAKE} ${BUILDFLAGS} samples )
-fi
-
 if ! which asterisk; then
 	echo "*** Failed to install Asterisk ***"
 	exit 1




More information about the svn-commits mailing list