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

AX_PROG_CC_FOR_BUILD patches that fix BUILD_{EXE,OBJ}EXT (Autoconf 2.70) #296

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Explorer09
Copy link

@Explorer09 Explorer09 commented May 8, 2024

This pull request is a mirror of patch #10452.

The BUILD_EXEEXT and BUILD_OBJEXT variables in AX_PROG_CC_FOR_BUILD are broken again in Autoconf 2.70 and later.

This patchset fixes compatibility problems found in Autoconf 2.70 and later.

  • Make BUILD_EXEEXT and BUILD_OBJEXT work again.
  • Tweak the previous workaround of ac_cv_c_compiler_gnu code and make the solution permanent. The users should now be able to override the ac_cv_build_c_compiler_gnu cache variable.
  • Fix regression where the ac_cv_prog_cc_c99 and ac_cv_prog_cc_c11 macros
    are not popped after the AX_PROG_CC_FOR_BUILD call.
  • Support ac_build_prog_cc_stdc (Autoconf 2.70) and ac_cv_build_prog_cc_c23 (Autoconf 2.73).

Autoconf 2.70 introduced a change in AC_SUBST behavior that the variable
name in AC_SUBST no longer gets macro expanded. This breaks the rename
syntaxes of BUILD_EXEEXT and BUILD_OBJEXT in AX_PROG_CC_FOR_BUILD.
Change to an alternative approach of assigning BUILD_EXEEXT and
BUILD_OBJEXT manually. The values of EXEEXT and OBJEXT have to be fixed
too at the end of the AX_PROG_CC_FOR_BUILD code.
Adjust the code of setting ac_cv_c_compiler_gnu to align with the code
of ac_cv_exeext and ac_cv_objext. The solution is now permanent rather
than just a workaround.
Fix regression where the ac_cv_prog_cc_c99 and ac_cv_prog_cc_c11 macros
are not popped after the AX_PROG_CC_FOR_BUILD call. This can cause
subsequents calls of AC_PROG_CC to use wrong cache variables to
indicate C standard support.

(Regression from serial 19 (16790f9).
Note: It's unlikely for projects to call AC_PROG_CC again after
AX_PROG_CC_FOR_BUILD, but such usage is valid.)
Improve compatibility with Autoconf 2.70 and later. Add support for
these variables for indicating build compiler capabilities:
* ac_cv_build_prog_cc_stdc (corresponding to ac_cv_prog_cc_stdc;
  Autoconf 2.70)
* ac_build_prog_cc_stdc (corresponding to ac_prog_cc_stdc;
  Autoconf 2.70)
* ac_cv_build_prog_cc_c23 (corresponding to ac_cv_prog_cc_c23;
  Autoconf 2.73)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant