Skip to content
Snippets Groups Projects
  1. Feb 01, 2022
    • George Joseph's avatar
      build: Add "basebranch" to .gitreview · 135e48de
      George Joseph authored
      If you have a development branch for a major project that
      will receive gerrit reviews it'll probably be named something
      like "development/16/newproject".  That will necessitate setting
      "defaultbranch=development/16/newproject" in .gitreview.  The
      make_version script uses that variable to construct the asterisk
      version however, which results in versions like
      "GIT-development/16/newproject-ee582a8c7b" which is probably not
      what you want.  Worse, since the download_externals script uses
      make_version to construct the URL to download the binary codecs
      or DPMA.  Since it's expecting a simple numeric version, the
      downloads will fail.
      
      To get this to work, a new variable "basebranch" has been added
      to .gitreview and make_version has been updated to use that instead
      of defaultversion:
      
      .gitreview:
      defaultbranch=development/16/myproject
      basebranch=16
      
      Now git-review will send the reviews to the proper branch
      (development/16/myproject) but the version will still be
      constructed using the simple branch number (16).
      
      If "basebranch" is missing from .gitreview, make_version will
      fall back to using "defaultbranch".
      
      Change-Id: I2941a3b21e668febeb6cfbc1a7bb51a67726fcc4
      135e48de
  2. Jan 19, 2022
    • Michał Górny's avatar
      build_tools/make_version: Fix sed(1) syntax compatibility with NetBSD · 90d02cf0
      Michał Górny authored
      Fix the sed(1) invocation used to process git-svn-id not to use "\s"
      that is a GNU-ism and is not supported by NetBSD sed.  As a result,
      this call did not work properly and make_version did output the full
      git-svn-id line rather than the revision.
      
      ASTERISK-29852
      
      Change-Id: Ie4b406e2748920643446851a0a252a4ca7245772
      90d02cf0
  3. Nov 16, 2021
    • Josh Soref's avatar
      build_tools: Spelling fixes · 8fb9588e
      Josh Soref authored
      Correct typos of the following word families:
      
      binutils
      
      ASTERISK-29714
      
      Change-Id: I2f676ab48cd50edc400c43307cb53679e4c09b97
      8fb9588e
  4. Oct 15, 2021
  5. Dec 09, 2020
    • lvl's avatar
      Introduce astcachedir, to be used for temporary bucket files · 92fcd4ed
      lvl authored
      As described in the issue, /tmp is not a suitable location for a
      large amount of cached media files, since most distributions make
      /tmp a RAM-based tmpfs mount with limited capacity.
      
      I opted for a location that can be configured separately, as opposed
      to using a subdirectory of spooldir, given the different storage
      profile (transient files vs files that might stay there indefinitely).
      
      This commit just makes the cache directory configurable, but leaves
      it at /tmp by default, to ensure backwards compatibility.
      
      A future commit that only targets master could change the default
      location to something more sensible such as /var/tmp/asterisk. At
      that point, the cachedir could be created and cleaned up during
      uninstall by the Makefile script.
      
      ASTERISK-29143
      
      Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
      92fcd4ed
  6. Aug 27, 2018
    • Corey Farrell's avatar
      Create --disable-binary-modules option. · a2001c00
      Corey Farrell authored
      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
      a2001c00
  7. Aug 01, 2018
    • Corey Farrell's avatar
      Build System: Improve ccache matching for different menuselect options. · a10a3aff
      Corey Farrell authored
      Changing any Menuselect option in the `Compiler Flags` section causes a
      full rebuild of the Asterisk source tree.  Every enabled option causes
      a #define to be added to buildopts.h, thus breaking ccache caching for
      every source file that includes "asterisk.h".  In most cases each option
      only applies to one or two files.  Now we only define those options for
      the specific sources which use them, this causes much better cache
      matching when working with multiple builds.  For example testing code
      with an without MALLOC_DEBUG will now use just over half the ccache
      size, only main/astmm.o will have two builds cached instead of every
      file.
      
      Reorder main/Makefile so _ASTCFLAGS set on specific object files are all
      together, sorted by filename.  Stop adding -DMALLOC_DEBUG to CFLAGS of
      bundled pjproject, this define is no longer used by any header so only
      serves to break cache.
      
      The only code change is a slight adjustment to how main/astmm.c is
      initialized.  Initialization functions always exist so main/asterisk.c
      can call them unconditionally.  Additionally rename the astmm
      initialization functions so they are not exported.
      
      Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
      a10a3aff
  8. Jul 23, 2018
    • Richard Mudgett's avatar
      core: AST_DEVMODE no longer affects ABI. · 0504594a
      Richard Mudgett authored
      Remove AST_DEVMODE from the AST_BUILDOPTS list and the AST_BUILDOPTS_SUM
      calculation as it no longer affects API/ABI compatibility.
      
      Change-Id: Id5bd6dfade173a53b3a49f715586b86e3fb24acb
      0504594a
  9. Jul 22, 2018
    • Corey Farrell's avatar
      build_tools/make_version: Get MAINLINE_BRANCH from .gitreview. · 747b65f6
      Corey Farrell authored
      Use .gitreview defaultbranch setting to determine the mainline branch.
      This allows the script to be used against other directories which might
      not be on the same defaultbranch.  This can be used by CI scripts to
      report the testsuite version being used:
      ./build_tools/make_version ${TESTSUITE_DIR}
      
      Change-Id: Ifdad4a9d8a26138c41bc6b630ecc3e34ea1c2758
      747b65f6
  10. Jul 18, 2018
  11. Mar 17, 2018
    • Alexander Traud's avatar
      BuildSystem: Remove unused dependency on libltdl. · 10a97882
      Alexander Traud authored
      Asterisk does not need the development package of libltdl, because it does not
      use any symbol of -lltdl directly. Instead, it uses the runtime package via the
      shared library -lodbc. On the supported platforms, that shared library declares
      its dependency on -lltdl correctly, otherwise AST_EXT_LIB_CHECK would have
      failed.
      
      ASTERISK-27745
      
      Change-Id: Icd315809b8e7978203431f3afb66240dd3a040ba
      10a97882
    • Corey Farrell's avatar
      core: Stop using AST_INLINE_API for allocator functions. · 4d1c9d87
      Corey Farrell authored
      This replaces AST_INLINE_API allocators in utils.h with real functions
      implemented in astmm.c.  Associated macro's are also moved from utils.h
      to astmm.h.
      
      Remove menuselect conflicts between MALLOC_DEBUG and DEBUG_CHAOS as they
      can now be combined.
      
      This has multiple benefits:
      * Simplifies asterisk/utils.h by removing inline functions and use of
        the logger.
      * Removal of these inline functions decreases size of Asterisk and
        module binaries by 1% or more.
      * Puts memory management functions together with and without
        MALLOC_DEBUG enabled, simplifying management of the code.
      * Enables DEBUG_CHAOS for ASTMM_REDIRECT and bundled pjproject.
      
      Change-Id: If9df4377f74bdbb627461b27a473123e05525887
      4d1c9d87
  12. Mar 01, 2018
    • Richard Mudgett's avatar
      core: Remove ABI effects of MALLOC_DEBUG. · c711e407
      Richard Mudgett authored
      This allows asterisk to be compiled with MALLOC_DEBUG to load modules
      built without MALLOC_DEBUG.  Now pre-compiled third-party modules will
      still work regardless of MALLOC_DEBUG being enabled or not.
      
      Change-Id: Ic07ad80b2c2df894db984cf27b16a69383ce0e10
      c711e407
  13. Feb 14, 2018
  14. Jan 28, 2018
    • Alexander Traud's avatar
      BuildSystem: Remove unused variables. · aaf14670
      Alexander Traud authored
      Because of a copy-and-paste from the script build_tools/download_externals,
      the script build_tools/list_valid_installed_externals got its local variables.
      However in the latter, three variables were not used actually.
      
      Change-Id: I252de5a98c17ea54459174875357c22c2eebe8d5
      aaf14670
  15. Jan 17, 2018
  16. Jan 12, 2018
  17. Dec 22, 2017
  18. Nov 19, 2017
    • Corey Farrell's avatar
      Build: Fix OSX build issues. · b4f7f825
      Corey Farrell authored
      OSX does not support 'readlink -f' or 'sed -r'.  Replace readlink with
      the GNU make macro 'realpath'.  Replace sed with grep in one place, cut
      in the other.
      
      ASTERISK-27332
      
      Change-Id: I5d34ecca905384decb22ead45c913ae5e8aff748
      b4f7f825
  19. Nov 06, 2017
    • Corey Farrell's avatar
      configure: Add autoconf check for libopusfile. · 4013bfa5
      Corey Farrell authored
      This check is being added to make it easier for end-users of third party
      open source Opus modules.  This was removed by ASTERISK-26426 but only
      the module needed to be removed.
      
      Change-Id: I62b9cd0c4fa8a77596ab0e042948a643a1152677
      4013bfa5
  20. Oct 20, 2017
  21. Aug 16, 2017
    • George Joseph's avatar
      Fix downloader not working with curl · 0e777258
      George Joseph authored
      The codec/dpma downloader wasn't handling curl correctly.  The logic
      that transforms makeopts into a bash-sourceable file wasn't
      handling the make 'or' command in DOWNLOAD_TIMEOUT so bash was
      looking for an 'or' command.
      
      That logic has been eliminated.  Instead of trying to transform
      and source makeopts, the downloader now calls a make scriptlet
      to print the value of a specific variable.  This way, make handles
      the ors (or any other make construct that happens to creep into
      that file).
      
      ASTERISK-27202
      Reported by: Sean McCord
      
      Change-Id: Iadfb6693528e4d4da7b8bb201fa66da2c71c7f99
      0e777258
  22. Aug 08, 2017
    • George Joseph's avatar
      Make --with-pjproject-bundled the default for Asterisk 15 · 305bd0d9
      George Joseph authored
      '--with-pjproject-bundled' is now the default when running
      ./configure. It can be disabled with '--without-pjproject-bundled'.
      
      To make building without an internet connection easier, a new
      ./configure option '--with-download-cache' was added that sets
      the cache for externals (like pjproject, the codecs and the DPMA),
      AND the sounds files.  It can also be specified as an environment
      variable named "AST_DOWNLOAD_CACHE".  The existing
      '--with-sounds-cache' option / SOUNDS_CACHE_DIR env variable and
      '--with-externals-cache' option / EXTERNALS_CACHE_DIR env variable
      remain and if specified, will override '--with-downloads-cache'.
      
      ASTERISK-27189
      
      Change-Id: Ifa9783fddf44aafadb060c9feba713dfa81d38ce
      305bd0d9
  23. Mar 27, 2017
  24. Feb 22, 2017
    • Michael L. Young's avatar
      build_tools: Fix download_externals to allow the use of curl or wget · 66a35e24
      Michael L. Young authored
      Not sure if this is really a bug versus an improvement. I can see it being
      viewed as a bug though by some.
      
      The current build_tools/download_externals file depends on wget in order to
      download external modules.  The current build system is able to discover
      which tool to use for fetching remote files - either wget or curl.
      
      This patch takes advantage of this capability by modifying the two calls to
      the wget binary to instead use what was discovered by the build system.
      
      ASTERISK-26812 #close
      
      Change-Id: If9411a2554f009274d377445613ae91192d948a1
      66a35e24
  25. Feb 15, 2017
  26. Jan 27, 2017
    • kkm's avatar
      make_build_h: handle backslashes in external strings · 138cd8d0
      kkm authored
      LikewiseOpen creates user names with a backslash in them. A gentle
      massage with sed(1) allows such strings to be inserted into build.h
      properly quoted. I am also adding the same for host name and other
      strings used in the script that are more or less user-controlled.
      
      ASTERISK-26754
      
      Change-Id: Iac5ef2b67a68ee58f35ddbf86bb818ba6eabecae
      138cd8d0
  27. Dec 21, 2016
  28. Nov 28, 2016
  29. Oct 12, 2016
  30. Sep 29, 2016
  31. Sep 27, 2016
    • George Joseph's avatar
      download_externals: Fix issue with re-install · a77ebb20
      George Joseph authored
      Needed to ignore an xmlstarlet return code for optional element.
      
      Change-Id: I6a96f709b4b38c9a3f3dda4e8b07903787e16873
      Reported-by: Dan Jenkins
      a77ebb20
    • George Joseph's avatar
      format_ogg_opus: New format · 40aa2813
      George Joseph authored
      Add Ogg/Opus playback support.
      
      This uses libopusfile in order to be able to read .opus files and play
      them back.
      
      Writing/recording support is not present at this time.
      
      ASTERISK-26409
      
      Change-Id: I8815d23345108d8ca7c0bd640f6a1ce6b4f56955
      (cherry picked from commit daee8bbd5209b4158bc1785eede845a26e6cbeaa)
      40aa2813
  32. Sep 25, 2016
    • George Joseph's avatar
      build_tools: Add ability to download variants to download_externals · 43901e94
      George Joseph authored
      Some external packages have multiple variants that apply to different
      builds of asterisk.  The DPMA for instance has a "bundled" variant that
      needs to be downloaded if asterisk was configured with
      --with-pjproject-bundled.
      
      There are 2 ways to specify variants:
      
      If you need the user to make the decision about which variant to
      download, simply create multiple menuselect "member" entries like so...
      
      <member name="res_digium_phone" displayname="..snipped..">
        <support_level>external</support_level>
        <depend>xmlstarlet</depend>
        <depend>bash</depend>
        <defaultenabled>no</defaultenabled>
      </member>
      
      <member name="res_digium_phone-bundled" displayname="..snipped..">
        <support_level>external</support_level>
        <depend>xmlstarlet</depend>
        <depend>bash</depend>
        <defaultenabled>no</defaultenabled>
      </member>
      
      Note that the second entry has "-<variant>" appended to the name.
      You can then use the existing menuselect facilities to restrict which
      members to enable or disable.  Youy probably don't want the user to
      enable multiple at the same time.
      
      If you want to hide the details of the variants, the better way to
      do it is to create 1 member with "variant" elements.
      
      <member name="res_digium_phone" displayname="..snipped..">
        <support_level>external</support_level>
        <depend>xmlstarlet</depend>
        <depend>bash</depend>
        <defaultenabled>no</defaultenabled>
        <member_data>
          <downloader>
            <variants>
              <variant tag="bundled"
                condition='[[ "$PJPROJECT_BUNDLED" = "yes" ]]'/>
            </variants>
          </downloader>
        </member_data>
      </member>
      
      The condition must be a bash expression suitable for use with an "if"
      statement.  Any environment variable can be used plus those available
      in makeopts.
      
      In this case, if asterisk was configured with --with-pjproject-bundled
      the bundled variant will be automatically downloaded.  Otherwise the
      normal version will be downloaded.
      
      Change-Id: I4de23e06d4492b0a65e105c8369966547d0faa3e
      43901e94
  33. Sep 06, 2016
    • George Joseph's avatar
      build: Add download capability for external packages · 6caf6bcd
      George Joseph authored
      The DPMA and g729a, silk, siren7 and siren14 codecs hosted at
      http://downloads.digium.com/pub/telephony/ are now listed in the
      "External" sections of the "Resource Modules" and "Codec Translators"
      pages in menuselect.  Any that are selected will automatically be
      downloaded and installed when "make install" is run.  Their LICENSE and
      README (if avaialble) files will be installed to
      ASTVARLIBDIR/documentation/thirdparty/<product_name>.
      
      Example use with codecs:
      
      The codecs/codecs.xml file is a menuselect style xml file that lists
      the codecs to be included.  Their support levels are 'external', which
      triggers the download and install, and defaultenabled is no.  Also
      because codec_g729a is actually in a directory named codec_g729 on the
      download server, the newly added 'member_data' element is used to
      override the default of the directory name being the package name.  You
      can use the 'directory_name' attribute to keep default base URL
      (http://downloads.digium.com/pub/telephony/) but use the new directory,
      or you use the 'remote_url' attribute to specify a full URL to the
      download directory.  In this case, you must still follow the same
      subdirectory naming conventions as that used for the packages located
      at 'http://downloads.digium.com/pub/telephony'.
      
      A new configure option '--with-externals-cache' was added and like
      '--with-sounds-cache' it allows the installer to cache tarballs so
      they're not downloaded every time.
      
      To assist with the download and install process, each external package
      now has a manifest.xml file that, among other things, contains a package
      version and checksums for each file in the tarball.  The manifest is
      saved to both the cache directory and ASTMODDIR and together with the
      manifest.xml on the downloads site, tells the install scripts whether
      a download and/or update is needed.
      
      bash and xmlstarlet are required for downloader operation.  If they're
      not installed, the external items in menuselect will be unavailable.
      
      Change-Id: Id3dcf1289ffd3cb0bbd7dfab3cafbb87be60323a
      6caf6bcd
  34. Aug 24, 2016
  35. Mar 13, 2016
    • George Joseph's avatar
      build_system: Split COMPILE_DOUBLE from DONT_OPTIMIZE · 0af6b5de
      George Joseph authored
      I can't ever recall actually needing the intermediate files or the checking
      that a double compile produces.  What I CAN remember is every DONT_OPTIMIZE
      build needing 3 invocations of gcc instead of 1 just to do the checks and
      produce those intermediate files.
      
      Having said that, Richard pointed out that the reason for the double compile
      was that there were cases in the past where a submitted patch failed to compile
      because the submitter never tried it with the optimizations turned on.
      
      To get the best of both worlds, COMPILE_DOUBLE has been split into its own
      option.  If DONT_OPTIMIZE is turned on, COMPILE_DOUBLE will also be selected
      BUT you can then turn it off if all you need are the debugging symbols.  This
      way you have to make an informed decision about disabling COMPILE_DOUBLE.
      
      To allow COMPILE_DOUBLE to be both auto-selected and turned off, a new feature
      was added to menuselect.  The <use> element can now contain an "autoselect"
      attribute which will turn the used member on but not create a hard dependency.
      The cflags.xml implementation for COMPILE_DOUBLE looks like this...
      
      <member name="DONT_OPTIMIZE" displayname="Disable Optimizations ...">
      	<use autoselect="yes">COMPILE_DOUBLE</use>
      	<support_level>core</support_level>
      </member>
      <member name="COMPILE_DOUBLE" displayname="Pre-compile with ...>
      	<depend>DONT_OPTIMIZE</depend>
      	<support_level>core</support_level>
      </member>
      
      When DONT_OPTIMIZE is turned on, COMPILE_DOUBLE is turned on because
      of the use.
      When DONT_OPTIMIZE is turned off, COMPILE_DOUBLE is turned off because
      of the depend.
      When COMPILE_DOUBLE is turned on, DONT_OPTIMIZE is turned on because
      of the depend.
      When COMPILE_DOUBLE is turned off, DONT_OPTIMIZE is left as is because
      it only uses COMPILE_DOUBLE, it doesn't depend on it.
      
      I also made a few tweaks to the ncurses implementation to move things
      left a bit to allow longer descriptions.
      
      Change-Id: Id49ca930ac4b5ec4fc2d8141979ad888da7b1611
      0af6b5de
  36. Feb 10, 2016
    • Badalyan Vyacheslav's avatar
      Build: Added testing compiler to support the system sanitizes · a23d01e9
      Badalyan Vyacheslav authored
      In older versions of the compiler was not sanitizes.
      Compilers other than GCC can not support the Usan and TSAN
      or have other options for *FLAGS.
      
      ASTERISK-25767 #close
      Reported by: Badalyan Vyacheslav
      Tested by: Badalyan Vyacheslav
      
      Change-Id: Iefce6608221fa87884b82ae3cb5649b7b1804916
      a23d01e9
Loading