egallesio / STklos

STklos Scheme
http://stklos.net
GNU General Public License v2.0
69 stars 17 forks source link

Have a configure parameter to enable VM statistics? #659

Closed jpellegrini closed 1 month ago

jpellegrini commented 1 month ago

Enabling VM statistics is done by defining a symbol during compilation:

./configure CFLAGS="-DSTAT_VM"

But maybe it would be nicer to actually have a configure parameter for that, since we have several others?

./configure --emable-vm-statistics

And include this in the configuration report? Maybe something like

...
System libraries used:  libffi libpcre2 libgmp libgc
   Compiled libraries: 
        VM statistics:  yes
 Documentation update:  yes (since Asciidoctor is installed)

I can work on that in the next weeks...

jpellegrini commented 1 month ago

Now that I think of it, what goes into environment variables, and what goes as configure flags? We have:

egallesio commented 1 month ago

Hi @jpellegrini,

I don't think this is useful to add complexity to the configure script, for something that will not probably be used a lot. It adds complexity for the user but to all the build system. For instance, DEFAULT_CS which is used in only one place of src/read.c appears in all the Makefiile.in and Makefile of the build tree (even in directories which don't have C files, the documentation, ...). Finally, the CFL AGS is accessible to the configure phase just for that. What is probably needed is to add some information int the QUICK_INSTALL.md file of what can additionally be passed to the CFLAGS for special customization.

If we look at the configure options we have now: we only have

The other options are a way to change the decisions taken by the configure script (for instance, use a provided library instead of the one found by the configure script, which can be outdated or buggy).

What do you think?

jpellegrini commented 1 month ago

Okay, that makes sense. I'll review the install instructions and see if there is anything missing there. Perhaps a section on environment variables would be useful...

egallesio commented 1 month ago

Now that I think of it, what goes into environment variables, and what goes as configure flags? We have:

* `DEBUG_VM`

* `STK_DEBUG`

* `STAT_VM`

* `USE_COMPUTED_GOTO`

See my response, just above :smiley: ?

BTW, USE_COMPUTED_GOTO is not a user parameter, it is defined by looking at the compiler capabilities. Using it with tcc would not work.

jpellegrini commented 1 month ago

Hi @egallesio ! See #661

egallesio commented 1 month ago

I think we can close it now. Thnaks for the PR

egallesio commented 1 month ago

Closing