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

Pass CXX and CXXFLAGS argument to ./configure scripts for build-type: Configure #10844

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpickering
Copy link
Collaborator

Since the compiler since ghc-9.4.8 requires a C++ toolchain, and that is configured into the compiler --info, it makes sense to pass that information onto the ./configure script.

The assumption that the C++ compiler is part of the toolchain is only since ghc-9.4. Therefore, if no C++ compiler is found, then the options won't be passed to the configure script.

For compilers older than 9.4, the C++ compiler will always be found as it is configured into the settings file.

See https://gitlab.haskell.org/ghc/ghc/-/issues/25767#note_610831 for some discussion about how this would be useful to implement system-cxx-std-lib in userspace.

Fixes #10797

Please read Github PR Conventions and then fill in one of these two templates.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:


Template B: This PR does not modify behaviour or interface

E.g. the PR only touches documentation or tests, does refactorings, etc.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

… Configure

Since the compiler since ghc-9.4.8 requires a C++ toolchain, and that is
configured into the compiler --info, it makes sense to pass that
information onto the ./configure script.

The assumption that the C++ compiler is part of the toolchain is only
since ghc-9.4. Therefore, if no C++ compiler is found, then the options
won't be passed to the configure script.

For compilers older than 9.4, the C++ compiler will always be found as
it is configured into the settings file.

See https://gitlab.haskell.org/ghc/ghc/-/issues/25767#note_610831 for
some discussion about how this would be useful to implement
system-cxx-std-lib in userspace.

Fixes #10797
@Ericson2314
Copy link
Collaborator

Seems basically good. I might try to make more gpp g++ or gxx, but I suppose I doesn't matter to much.

I don't really get why Cabal is asking GHC what toolchains to use, but I suppose that is just inheriting the current behavior, so better to be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass C++ environment variables to configure scripts
2 participants