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 script does not honour honor CC environement variable #5418
Comments
Comment author: meyer Hello, I am not sure what kind of improvement it gives over -cc and -as command line options. In particular, how it should interact with these. My worry is also that it's too implicit. Why not to say ./configure -cc ${CC} -as ${AS} ? However I'm not maintaining any packages, so I have no strong evidence if such tweak to environment would work out much better. If you provide some examples how it will improve packaging I'd be grateful. Best, |
Comment author: michi Hi Wojciech, Mantis Bug Tracker wrote:
This way of passing arguments to configure files is consistent with the way to pass arguments to Makefiles. GNU Autotools (autoconf et al.) also stick to this convention. (Most probably, people working on a project requiring fancy compiler options have a shell code snippet setting CC, CFLAGS, etc. that they can source before starting to work in the project.)
Taking CC into account makes packaging easier, because CC just works the same way as with other packages. At that time, the FreeBSD port patches ocaml's Makefiles to let them understand CC. If you are open for a patch, I will submit you a more accurate version than the one I sent the first time. Best, |
Comment author: @damiendoligez I tend to agree with Wojciech, it's too implicit. More than once I've had a spurious environment variable that caused strange errors and wasted a lot of my time. See the discussion of #5385 for an example. Also, it's not clear whether you want to change the behaviour of "configure" or the Makefiles themselves. |
Comment author: michi It seems that the FreeBSD port will keep its patch to the upstream build system for quite a long time… which is also fine, as far as I am concerned. However, while I agree that configuration options passed by environment variable may be a bit implicit (and it sometimes bate me as well), I would like to make two points:
Console programs in KDE or OS-X also have a notion of Best regards, |
Comment author: @avsm I don't quite understand why the FreeBSD port needs to patch any Makefiles. The OpenBSD port simply passes: CONFIGURE_ARGS+=-cc '${CC} ${CFLAGS}' which lets the ports system work fine with a custom CC and/or CFLAGS. |
Comment author: michi While porting ocaml-4.00.1 I decided to switch the old strategy I inherited with the port to the one you suggested. Meanwhile I noticed that gcc is hardcoded Makefile portions generating dependencies (grep for 'gcc -MM'). The concerned files are:
As FreeBSD maintainer of the port, I am interested in using clang as a compiler and 'clang -MM' does the same work as 'gcc -MM'. I made simple tests, and it seems that 'gcc/clang -MM' works fine when given superfluous options, so it could be an acceptable solution to replace 'gcc -MM' by '${CC} -MM'. |
Comment author: @damiendoligez I don't like having gcc hard-coded in the Makefiles. We should see if we can change that. |
Comment author: @damiendoligez For making For using |
Original bug ID: 5418
Reporter: michi
Status: closed (set by @damiendoligez on 2015-01-20T17:03:11Z)
Resolution: won't fix
Priority: low
Severity: trivial
Platform: All
OS: All
OS Version: All
Version: 3.12.1
Target version: 4.02.2+dev / +rc1
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Monitored by: mww
Bug description
OCaml's configure script does not honor some environment variables used by some other configure scripts to convey configuration options. Taking these variables into account makes OCaml build procedure blend smoothly in OS packages systems.
The targeted variables are: CC, AS.
File attachments
The text was updated successfully, but these errors were encountered: