[Asterisk-code-review] Create --disable-binary-modules option. (asterisk[master])

George Joseph asteriskteam at digium.com
Wed Aug 29 06:31:55 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10006 )

Change subject: Create --disable-binary-modules option.
......................................................................

Create --disable-binary-modules option.

This new option can be passed for ./configure or
./tests/CI/buildAsterisk.sh to prevent download/install of binary
modules.

Normally enabling the categories MENUSELECT_CODECS or MENUSELECT_RES
will result in binary modules being enabled even if the build target is
incompatible with those modules.  This includes CI scripts which enable
categories before disabling specific modules.

If more binary modules are offered in the future this will help avoid
accidentally downloading them if unwanted or incompatible.  Adding a
binary module will only require creating a new menuselect entry similar
to the existing ones, it will not be necessary to modify the CI scripts.

Change-Id: I6b1bd1c75a2e48f05b8b8a45b7a7a2d00a079166
---
M build_tools/menuselect-deps.in
M codecs/codecs.xml
M configure
M configure.ac
M res/res.xml
M tests/CI/buildAsterisk.sh
6 files changed, 40 insertions(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve; Approved for Submit
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved



diff --git a/build_tools/menuselect-deps.in b/build_tools/menuselect-deps.in
index e62c183..161c67b 100644
--- a/build_tools/menuselect-deps.in
+++ b/build_tools/menuselect-deps.in
@@ -82,3 +82,4 @@
 HAVE_LEAK_SANITIZER=@AST_LEAK_SANITIZER@
 HAVE_THREAD_SANITIZER=@AST_THREAD_SANITIZER@
 HAVE_UNDEFINED_SANITIZER=@AST_UNDEFINED_SANITIZER@
+NO_BINARY_MODULES=@PBX_NO_BINARY_MODULES@
diff --git a/codecs/codecs.xml b/codecs/codecs.xml
index 0b4e2a4..996a355 100644
--- a/codecs/codecs.xml
+++ b/codecs/codecs.xml
@@ -1,5 +1,6 @@
 <member name="codec_opus" displayname="Download the Opus codec from Digium.  See http://downloads.digium.com/pub/telephony/codec_opus/README.">
 	<support_level>external</support_level>
+	<conflict>no_binary_modules</conflict>
 	<depend>xmlstarlet</depend>
 	<depend>bash</depend>
 	<depend>res_format_attr_opus</depend>
@@ -7,24 +8,28 @@
 </member>
 <member name="codec_silk" displayname="Download the SILK codec from Digium.  See http://downloads.digium.com/pub/telephony/codec_silk/README.">
 	<support_level>external</support_level>
+	<conflict>no_binary_modules</conflict>
 	<depend>xmlstarlet</depend>
 	<depend>bash</depend>
 	<defaultenabled>no</defaultenabled>
 </member>
 <member name="codec_siren7" displayname="Download the Siren7 codec from Digium.  See http://downloads.digium.com/pub/telephony/codec_siren7/README.">
 	<support_level>external</support_level>
+	<conflict>no_binary_modules</conflict>
 	<depend>xmlstarlet</depend>
 	<depend>bash</depend>
 	<defaultenabled>no</defaultenabled>
 </member>
 <member name="codec_siren14" displayname="Download the Siren14 codec from Digium.  See http://downloads.digium.com/pub/telephony/codec_siren14/README.">
 	<support_level>external</support_level>
+	<conflict>no_binary_modules</conflict>
 	<depend>xmlstarlet</depend>
 	<depend>bash</depend>
 	<defaultenabled>no</defaultenabled>
 </member>
 <member name="codec_g729a" displayname="Download the g729a codec from Digium.  A license must be purchased for this codec.  See http://downloads.digium.com/pub/telephony/codec_g729/README.">
 	<support_level>external</support_level>
+	<conflict>no_binary_modules</conflict>
 	<depend>xmlstarlet</depend>
 	<depend>bash</depend>
 	<defaultenabled>no</defaultenabled>
diff --git a/configure b/configure
index b24fedb..c453501 100755
--- a/configure
+++ b/configure
@@ -1201,6 +1201,7 @@
 AST_DEVMODE_STRICT
 AST_DEVMODE
 NOISY_BUILD
+PBX_NO_BINARY_MODULES
 PTHREAD_CFLAGS
 PTHREAD_LIBS
 PTHREAD_CC
@@ -1351,6 +1352,7 @@
 ac_user_opts='
 enable_option_checking
 with_gnu_ld
+enable_binary_modules
 enable_dev_mode
 with_download_cache
 with_sounds_cache
@@ -2089,6 +2091,8 @@
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-binary-modules
+                          Block installation of binary modules.
   --enable-dev-mode       Turn on developer mode
   --enable-coverage       Turn on code coverage tracking (for gcov)
   --disable-xmldoc        Explicitly disable XML documentation
@@ -8914,6 +8918,18 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+PBX_NO_BINARY_MODULES=0
+# Check whether --enable-binary-modules was given.
+if test "${enable_binary_modules+set}" = set; then :
+  enableval=$enable_binary_modules; case "${enableval}" in
+	      y|ye|yes) PBX_NO_BINARY_MODULES=0 ;;
+	      n|no)  PBX_NO_BINARY_MODULES=1 ;;
+	      *) as_fn_error $? "bad value ${enableval} for --disable-binary-modules" "$LINENO" 5  ;;
+	esac
+fi
+
+
+
 # Check whether --enable-dev-mode was given.
 if test "${enable_dev_mode+set}" = set; then :
   enableval=$enable_dev_mode; case "${enableval}" in
diff --git a/configure.ac b/configure.ac
index 8537aca..431b3da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -385,6 +385,17 @@
 
 AC_LANG(C)
 
+PBX_NO_BINARY_MODULES=0
+AC_ARG_ENABLE([binary-modules],
+	[AS_HELP_STRING([--disable-binary-modules],
+		[Block installation of binary modules.])],
+	[case "${enableval}" in
+	      y|ye|yes) PBX_NO_BINARY_MODULES=0 ;;
+	      n|no)  PBX_NO_BINARY_MODULES=1 ;;
+	      *) AC_MSG_ERROR(bad value ${enableval} for --disable-binary-modules)  ;;
+	esac])
+AC_SUBST(PBX_NO_BINARY_MODULES)
+
 AC_ARG_ENABLE([dev-mode],
 	[AS_HELP_STRING([--enable-dev-mode],
 		[Turn on developer mode])],
diff --git a/res/res.xml b/res/res.xml
index a340cc2..ace1792 100644
--- a/res/res.xml
+++ b/res/res.xml
@@ -1,5 +1,6 @@
 <member name="res_digium_phone" displayname="Download the Digium Phone Module for Asterisk.  See http://downloads.digium.com/pub/telephony/res_digium_phone/README.">
 	<support_level>external</support_level>
+	<conflict>no_binary_modules</conflict>
 	<depend>xmlstarlet</depend>
 	<depend>bash</depend>
 	<defaultenabled>no</defaultenabled>
diff --git a/tests/CI/buildAsterisk.sh b/tests/CI/buildAsterisk.sh
index 60f0917..992dc94 100755
--- a/tests/CI/buildAsterisk.sh
+++ b/tests/CI/buildAsterisk.sh
@@ -3,6 +3,7 @@
 CIDIR=$(dirname $(readlink -fn $0))
 COVERAGE=0
 REF_DEBUG=0
+DISABLE_BINARY_MODULES=0
 source $CIDIR/ci.functions
 
 gen_cats() {
@@ -78,6 +79,10 @@
 if [ $COVERAGE -eq 1 ] ; then
 	common_config_args+=" --enable-coverage"
 fi
+if [ "$BRANCH_NAME" == "master" -o $DISABLE_BINARY_MODULES -eq 1 ] ; then
+	common_config_args+=" --disable-binary-modules"
+fi
+
 export WGET_EXTRA_ARGS="--quiet"
 
 runner ./configure ${common_config_args} > ${OUTPUT_DIR:+${OUTPUT_DIR}/}configure.txt
@@ -115,7 +120,7 @@
 	mod_disables+=" res_ael_share res_calendar res_config_ldap res_config_pgsql res_corosync"
 	mod_disables+=" res_http_post res_pktccops res_rtp_multicast res_snmp res_xmpp"
 fi
-[ "$BRANCH_NAME" == "master" ] && mod_disables+=" codec_opus codec_silk codec_g729a codec_siren7 codec_siren14"
+
 runner menuselect/menuselect `gen_mods disable $mod_disables` menuselect.makeopts
 
 mod_enables="app_voicemail app_directory FILE_STORAGE"

-- 
To view, visit https://gerrit.asterisk.org/10006
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6b1bd1c75a2e48f05b8b8a45b7a7a2d00a079166
Gerrit-Change-Number: 10006
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180829/620eda99/attachment-0001.html>


More information about the asterisk-code-review mailing list