]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Create --disable-binary-modules option.
authorCorey Farrell <git@cfware.com>
Sun, 26 Aug 2018 18:18:42 +0000 (14:18 -0400)
committerCorey Farrell <git@cfware.com>
Mon, 27 Aug 2018 18:51:29 +0000 (13:51 -0500)
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

build_tools/menuselect-deps.in
codecs/codecs.xml
configure
configure.ac
res/res.xml
tests/CI/buildAsterisk.sh

index 2c2bd532b2e2197acb0c340249f122d066653a35..f1cd20df2e5a5175cad7cf3bb58f4827197302cf 100644 (file)
@@ -77,3 +77,4 @@ HAVE_ADDRESS_SANITIZER=@AST_ADDRESS_SANITIZER@
 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@
index 0b4e2a4740efd14085131341e7c140afe9bc760b..996a3559b758de4e1f09db99d6b74687fda14c5b 100644 (file)
@@ -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>
index 41faa876aef894294b2e69a9f3f37b2e4a10c2a7..f3440e5cb1c00ea460ff74a19872f7f7e77b36ea 100755 (executable)
--- a/configure
+++ b/configure
@@ -1187,6 +1187,7 @@ AST_DOWNLOAD_CACHE
 AST_DEVMODE_STRICT
 AST_DEVMODE
 NOISY_BUILD
+PBX_NO_BINARY_MODULES
 PTHREAD_CFLAGS
 PTHREAD_LIBS
 PTHREAD_CC
@@ -1337,6 +1338,7 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 with_gnu_ld
+enable_binary_modules
 enable_dev_mode
 with_download_cache
 with_sounds_cache
@@ -2074,6 +2076,8 @@ Optional Features:
   --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
@@ -8896,6 +8900,18 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 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
index caab39dad58745b7d68acfba6f08a2bffcde45af..0823e1de4c76b8d07142dc71053df3b3632b07ab 100644 (file)
@@ -386,6 +386,17 @@ AX_PTHREAD
 
 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])],
index a340cc2fdc5ead646866133aacc795b68dc9d359..ace1792650deafe90f5a5fd834251f803739d195 100644 (file)
@@ -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>
index b3266bdac8eeaf67c2d3be344d8fc3ff980cbdaa..b36e7de6c4c13b8477c4bf467e51ac061b5dab45 100755 (executable)
@@ -3,6 +3,7 @@
 CIDIR=$(dirname $(readlink -fn $0))
 COVERAGE=0
 REF_DEBUG=0
+DISABLE_BINARY_MODULES=0
 source $CIDIR/ci.functions
 
 gen_cats() {
@@ -76,6 +77,10 @@ common_config_args+=" --enable-dev-mode"
 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
@@ -120,7 +125,7 @@ if [ $REF_DEBUG -eq 1 ] ; then
        # To test for reference leaks with realtime usage you must test against Asterisk 16+.
        mod_disables+=" res_odbc"
 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"