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

Allow easy retrieval of Makefile.config's values #7116

Closed
vicuna opened this issue Jan 5, 2016 · 5 comments
Closed

Allow easy retrieval of Makefile.config's values #7116

vicuna opened this issue Jan 5, 2016 · 5 comments

Comments

@vicuna
Copy link

vicuna commented Jan 5, 2016

Original bug ID: 7116
Reporter: adrien
Status: feedback (set by @shindere on 2017-02-22T15:11:36Z)
Resolution: open
Priority: normal
Severity: feature
Category: configure and build/install
Related to: #4957

Bug description

Currently the values in Makefile.config are difficult to extract. While looking at ocamlbuild's #38 PR on github I tried to get a cleaner way to get them and found out that someone has already done it elegantly and explained it well: http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html .

Basically, adding the following to a Makefile creates a pattern rule than can then be used to print the value of the variable which name is used in the pattern.

print-%:
        @echo $*=$($*)

For instance, on my machine, "make -f config/Makefile print-MKEXE" will print "MKEXE=gcc". We can also skip the "MKEXE=" part if we want (I think it makes more sense for us actually).

This would greatly simplify changes in various places and avoid having to "include" the config makefile which means overwriting all the corresponding variables. It would help a lot to have it in 4.03.

@vicuna
Copy link
Author

vicuna commented Jan 5, 2016

Comment author: @gasche

One other approach to do this which I also considered is to make it easier to extract information from $(ocamlc -config) without parsing step. For example, $(ocamlc -config-key ext_obj) would be the string ".o".

I'm fine with adrien's proposal which seems easier to implement (-config exposes more information than Makefile.config, but in practice the information I needed is available in both).

@vicuna
Copy link
Author

vicuna commented Feb 22, 2017

Comment author: @shindere

Isn't ocamlc -config enough? Can you give an example of a place where this would improve the situation?

@vicuna
Copy link
Author

vicuna commented Oct 14, 2017

Comment author: @gasche

#1430 proposes a -config-var option for 4.07:

#1430

@github-actions
Copy link

github-actions bot commented May 9, 2020

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 9, 2020
@xavierleroy
Copy link
Contributor

Wish fulfilled in #1430.

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

No branches or pull requests

2 participants