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

configure: WARNING: unrecognized options: --with-compiler #20

Closed
lyokha opened this issue Mar 27, 2023 · 3 comments · Fixed by #21
Closed

configure: WARNING: unrecognized options: --with-compiler #20

lyokha opened this issue Mar 27, 2023 · 3 comments · Fixed by #21

Comments

@lyokha
Copy link
Collaborator

lyokha commented Mar 27, 2023

Cabal unconditionally passes option --with-compiler or --with-hc in Distribution.Simple.Setup.configureArgs. This makes configure run from cabal v1-configure or cabal v2-build print the warning.

This can be fixed by declaring dummy with-options in configure.ac

diff --git a/configure.ac b/configure.ac
index 93942e2..1a1c036 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,10 @@ AC_CONFIG_HEADERS([cbits/hs_resolv_config.h])
 AC_PROG_CC
 AC_C_CONST
 
+dnl ignore options --with-compiler and --with-hc passed by cabal configure
+AC_ARG_WITH([compiler], [], [], [])
+AC_ARG_WITH([hc], [], [], [])
+
 AC_CHECK_HEADERS([netinet/in.h arpa/nameser.h])
 AC_CHECK_HEADER([resolv.h],,AC_MSG_ERROR([required <resolv.h> header not found]),[[
 #include <sys/types.h>
@lyokha
Copy link
Collaborator Author

lyokha commented Mar 28, 2023

Thanks for the links! I found a good comment reading through them: haskell/cabal#2946 (comment). It says that a few packages want to "shut up" this warning by supplying macro definitions similar to what I proposed (except that I skip the help message). This all makes sense so far as the configure script makes no adjustments related to haskell compiler (as in the resolv's configure, and this is why it complains about the option) and only tests and configures C bits.

@andreasabel
Copy link
Member

This all makes sense so far as the configure script makes no adjustments related to haskell compiler (as in the resolv's configure,

Ok, this sounds like you could go ahead with your proposed change.

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 a pull request may close this issue.

2 participants