Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid clobbering user variables in autotools files #747

Merged
merged 4 commits into from
Apr 19, 2024
Merged

Conversation

bregma
Copy link
Member

@bregma bregma commented Apr 18, 2024

configure.ac and the various Makefile.am files were clobbering user variables CFLAGS, CPPFLAGS, and CCASFLAGS. This causes trouble when a user want to set those variables from the command line during a build (eg. make CFLAGS="-g -O0").

This change replaces that clobber with various UNW_ variables propagated through the system.
Closes #744
Closes #743

The user variable CCASFLAGS should never be set in configure.ac, and the
default AM_CCASFLAGS already has AM_CPPFLAGS added so it ends up
appearing in the command line twice.

Remove setting both of these variables so using the user variable from
the command line will do the right thing and there is less noise in the
build logs.
Enabling debug mode was convoluted and added cognitive load.

This change simplifies how the configuration option --enable-debug works
by simply adding -DUNW_DEBUG=1 to the preprocesor flags via a specific
confiuration variable, accomplishing the folowing goals.
    - don't clobber the CPPFLAGS user variable
    - don't mess with -DNDEBUG which has other meanings orthogonal
      to libunwind debug mode
    - don't hide the definition of the ABI-changing build-time option
      behind an ifdef in an internal header file

In addition I added a warning to confogure --help to point out that
enabling the option changes the ABI. Caveat lector.
Replaced defining the user variable CPPFLAGS in configure.ac with
UNW_REMOTE_CPPFLAGS and UNW_TARGET_CPPFLAGS.
Replaced the clobbering of the user variable CFLAGS in configure.ac with
UNW_EXTRA_CFLAGS.
@bregma bregma changed the title Avoid clobberiung user variables in autotools files Avoid clobbering user variables in autotools files Apr 18, 2024
@bregma bregma merged commit 8428e1f into master Apr 19, 2024
15 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant