]> git.ipfire.org Git - thirdparty/asterisk.git/commit
make_buildopts_h, et. al. Allow adding all cflags to buildopts.h
authorGeorge Joseph <gjoseph@sangoma.com>
Wed, 13 Sep 2023 20:08:02 +0000 (14:08 -0600)
committeret. al. Allow adding all cflags to buildopts.h <George Joseph|gjoseph@sangoma.com|>
Thu, 14 Sep 2023 17:58:22 +0000 (17:58 +0000)
commit8d506370f511d32a9100894b03718c0b5bb2140e
tree1da1ea752abd7d3e765c2eebcbb9fb5fb608d188
parentcf623753a9041f6c22238c8b0f91ec7dd4d899d4
make_buildopts_h, et. al.  Allow adding all cflags to buildopts.h

The previous behavior of make_buildopts_h was to not add the
non-ABI-breaking MENUSELECT_CFLAGS like DETECT_DEADLOCKS,
REF_DEBUG, etc. to the buildopts.h file because "it caused
ccache to invalidate files and extended compile times". They're
only defined by passing them on the gcc command line with '-D'
options.   In practice, including them in the include file rarely
causes any impact because the only time ccache cares is if you
actually change an option so the hit occurrs only once after
you change it.

OK so why would we want to include them?  Many IDEs follow the
include files to resolve defines and if the options aren't in an
include file, it can cause the IDE to mark blocks of "ifdeffed"
code as unused when they're really not.

So...

* Added a new menuselect compile option ADD_CFLAGS_TO_BUILDOPTS_H
  which tells make_buildopts_h to include the non-ABI-breaking
  flags in buildopts.h as well as the ABI-breaking ones. The default
  is disabled to preserve current behavior.  As before though,
  only the ABI-breaking flags appear in AST_BUILDOPTS and only
  those are used to calculate AST_BUILDOPT_SUM.
  A new AST_BUILDOPT_ALL define was created to capture all of the
  flags.

* make_version_c was streamlined to use buildopts.h and also to
  create asterisk_build_opts_all[] and ast_get_build_opts_all(void)

* "core show settings" now shows both AST_BUILDOPTS and
  AST_BUILDOPTS_ALL.

UserNote: The "Build Options" entry in the "core show settings"
CLI command has been renamed to "ABI related Build Options" and
a new entry named "All Build Options" has been added that shows
both breaking and non-breaking options.
Makefile
build_tools/cflags.xml
build_tools/make_buildopts_h
build_tools/make_version_c
include/asterisk/ast_version.h
main/asterisk.c