]> 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:12 +0000 (17:58 +0000)
commit55eca816b17f7ec09b3105087826f8bff6c09ae2
tree2eed0f977f1e8a3bb2241d4417fb4707453b6bb7
parent13da50219ec3a4a44e88d1f28e88909702b3af57
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