Skip to content
Snippets Groups Projects
  1. Jul 13, 2022
    • Mike Bradeen's avatar
      Makefile: Avoid git-make user conflict · 7cc026b3
      Mike Bradeen authored
      make_version now silently checks if the required git commands will
      fail.  If they do, then return UNKNOWN__git_check_fail to
      distinguish this failure from other UNKNOWN__ version failures
      
      Makefile checks for this value on install and exits out with
      instructions
      
      ASTERISK-30029
      
      Change-Id: If8f10cac8f509c08981120f17555762342020221
      7cc026b3
  2. Mar 29, 2022
    • George Joseph's avatar
      make_xml_documentation: Remove usage of get_sourceable_makeopts · 144b3c54
      George Joseph authored
      get_sourceable_makeopts wasn't handling variables with embedded
      double quotes in them very well.  One example was the DOWNLOAD
      variable when curl was being used instead of wget.  Rather than
      trying to fix get_sourceable_makeopts, it's just been removed.
      
      ASTERISK-29986
      Reported by: Stefan Ruijsenaars
      
      Change-Id: Idf2a90902228c2558daa5be7a4f8327556099cd2
      144b3c54
  3. Mar 23, 2022
  4. Mar 03, 2022
    • George Joseph's avatar
      xml.c, config,c: Add stylesheets and variable list string parsing · b40c4d59
      George Joseph authored
      Added functions to open, close, and apply XML Stylesheets
      to XML documents.  Although the presence of libxslt was already
      being checked by configure, it was only happening if xmldoc was
      enabled.  Now it's checked regardless.
      
      Added ability to parse a string consisting of comma separated
      name/value pairs into an ast_variable list.  The reverse of
      ast_variable_list_join().
      
      Change-Id: I1e1d149be22165a1fb8e88e2903a36bba1a6cf2e
      b40c4d59
  5. Mar 01, 2022
    • George Joseph's avatar
      xmldoc: Fix issue with xmlstarlet validation · 9c36c055
      George Joseph authored
      Added the missing xml-stylesheet and Xinclude namespace
      declarations in pjsip_config.xml and pjsip_manager.xml.
      
      Updated make_xml_documentation to show detailed errors when
      xmlstarlet is the validator.  It's now run once with the '-q'
      option to suppress harmless/expected messages and if it actually
      fails, it's run again without '-q' but with '-e' to show
      the actual errors.
      
      Change-Id: I4bdc9d2ea6741e8d2e5eb82df60c68ccc59e1f5e
      9c36c055
  6. Feb 28, 2022
    • George Joseph's avatar
      Makefile: Allow XML documentation to exist outside source files · 2e00b5ed
      George Joseph authored
      Moved the xmldoc build logic from the top-level Makefile into
      its own script "make_xml_documentation" in the build_tools
      directory.
      
      Created a new utility script "get_sourceable_makeopts", also in
      the build_tools directory, that dumps the top-level "makeopts"
      file in a format that can be "sourced" from shell sscripts.
      This allows scripts to easily get the values of common make
      build variables such as the location of the GREP, SED, AWK, etc.
      utilities as well as the AST* and library *_LIB and *_INCLUDE
      variables.
      
      Besides moving logic out of the Makefile, some optimizations
      were done like removing "third-party" from the list of
      subdirectories to be searched for documentation and changing some
      assignments from "=" to ":=" so they're only evaluated once.
      The speed increase is noticeable.
      
      The makeopts.in file was updated to include the paths to
      REALPATH and DIRNAME.  The ./conifgure script was setting them
      but makeopts.in wasn't including them.
      
      So...
      
      With this change, you can now place documentation in any"c"
      source file AND you can now place it in a separate XML file
      altogether.  The following are examples of valid locations:
      
      res/res_pjsip.c
          Using the existing /*** DOCUMENTATION ***/ fragment.
      
      res/res_pjsip/pjsip_configuration.c
          Using the existing /*** DOCUMENTATION ***/ fragment.
      
      res/res_pjsip/pjsip_doc.xml
          A fully-formed XML file.  The "configInfo", "manager",
          "managerEvent", etc. elements that would be in the "c"
          file DOCUMENTATION fragment should be wrapped in proper
          XML.  Example for "somemodule.xml":
      
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE docs SYSTEM "appdocsxml.dtd">
          <docs>
              <configInfo>
              ...
              </configInfo>
          </docs>
      
      It's the "appdocsxml.dtd" that tells make_xml_documentation
      that this is a documentation XML file and not some other XML file.
      It also allows many XML-capable editors to do formatting and
      validation.
      
      Other than the ".xml" suffix, the name of the file is not
      significant.
      
      As a start... This change also moves the documentation that was
      in res_pjsip.c to 2 new XML files in res/res_pjsip:
      pjsip_config.xml and pjsip_manager.xml.  This cut the number of
      lines in res_pjsip.c in half. :)
      
      Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade
      2e00b5ed
    • George Joseph's avatar
      build: Refactor the earlier "basebranch" commit · 1950cec3
      George Joseph authored
      Recap from earlier commit:  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" or a work branch
      based on that "development" branch.  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.  It also constructs the URLs for downloading
      external modules with that version, which will fail.
      
      Fast-forward:
      
      The earlier attempt at adding a "basebranch" variable to
      .gitreview didn't work out too well in practice because changes
      were made to .gitreview, which is a checked-in file.  So, if
      you wanted to rebase your work branch on the base branch, rebase
      would attempt to overwrite your .gitreview with the one from
      the base branch and complain about a conflict.
      
      This is a slighltly different approach that adds three methods to
      determine the mainline branch:
      
      1.  --- MAINLINE_BRANCH from the environment
      
      If MAINLINE_BRANCH is already set in the environment, that will
      be used.  This is primarily for the Jenkins jobs.
      
      2.  --- .develvars
      
      Instead of storing the basebranch in .gitreview, it can now be
      stored in a non-checked-in ".develvars" file and keyed by the
      current branch.  So, if you were working on a branch named
      "new-feature-work" based on "development/16/new-feature" and wanted
       to push to that branch in Gerrit but wanted to pull the external
       modules for 16, you'd create the following .develvars file:
      
      [branch "new-feature-work"]
          mainline-branch = 16
      
      The .gitreview file would still look like:
      
      [gerrit]
      defaultbranch=development/16/new-feature
      
      ...which would cause any reviews pushed from "new-feature-work" to
      go to the "development/16/new-feature" branch in Gerrit.
      
      The key is that the .develvars file is NEVER checked in (it's been
      added to .gitignore).
      
      3.  --- Well Known Development Branch
      
      If you're actually working in a branch named like
      "development/<mainline_branch>/some-feature", the mainline branch
      will be parsed from it.
      
      4.  --- .gitreview
      
      If none of the earlier conditions exist, the .gitreview
      "defaultbranch" variable will be used just as before.
      
      Change-Id: I1cdeeaa0944bba3f2e01d7a2039559d0c266f8c9
      1950cec3
  7. Feb 01, 2022
    • Sean Bright's avatar
      build_tools/make_version: Fix bashism in comparison. · 4126d703
      Sean Bright authored
      In POSIX sh (which we indicate in the shebang), there is no ==
      operator.
      
      Change-Id: Ic03d38214d14cdf329b0ba272279a815bb532965
      4126d703
    • George Joseph's avatar
      build: Add "basebranch" to .gitreview · bfc4d63d
      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
      bfc4d63d
  8. Jan 19, 2022
    • Michał Górny's avatar
      build_tools/make_version: Fix sed(1) syntax compatibility with NetBSD · 23be22ab
      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
      23be22ab
  9. Nov 16, 2021
    • Josh Soref's avatar
      build_tools: Spelling fixes · b4966c4f
      Josh Soref authored
      Correct typos of the following word families:
      
      binutils
      
      ASTERISK-29714
      
      Change-Id: I2f676ab48cd50edc400c43307cb53679e4c09b97
      b4966c4f
  10. Oct 15, 2021
  11. Aug 17, 2021
  12. Dec 09, 2020
    • lvl's avatar
      Introduce astcachedir, to be used for temporary bucket files · b0842713
      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, and changes
      the default location from /tmp to /var/cache/asterisk.
      
      ASTERISK-29143
      
      Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
      b0842713
  13. 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
  14. 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
  15. 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
  16. 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
  17. Jul 18, 2018
  18. 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
  19. 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
  20. Feb 14, 2018
  21. 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
  22. Jan 17, 2018
  23. Jan 12, 2018
  24. Dec 22, 2017
  25. 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
  26. 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
  27. Oct 20, 2017
  28. 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
  29. 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
  30. Mar 27, 2017
  31. 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
Loading