Boehm

This autoconf macro checks for gc.h, libgc.a, and checks the version number and thread support. Example usage:

AC_BOEHM(7.0)

This is a first draft, tested only on cygwin, so it needs testing on other platforms.

Attached to this page (click on "files" at the bottom of the page) is file acinclude.m4 containing the code, and file configure.ac that you can use to test it.

To test, put acinclude.m4 and configure.ac in the same directory. Then run:

$ aclocal
$ automake —add-missing
At this point automake may complain about missing files like AUTHORS, NEWS, etc. Just do
$ touch AUTHORS NEWS …
$ autoconf

Then running configure should look something like:
$ ./configure

checking for gc.h… yes
checking for library containing GC_thr_init… -lgc
configure: WARNING: Boehm Garbage Collector multithreaded.
configure: WARNING: Compile it with —disable-threads for better performance.
configure: WARNING: See the "Memory Managment" section of INSTALL for details.
checking version of gc… version 7.0

$ ./configure —without-bgc

configure: Disabling Boehm GC

$ ./configure —with-bgc=~/dev/gc6.6/.libs

checking for gc.h… yes
checking for library containing GC_thr_init… -lgc
configure: WARNING: Boehm Garbage Collector multithreaded.
configure: WARNING: Compile it with —disable-threads for better performance.
configure: WARNING: See the "Memory Managment" section of INSTALL for details.
checking version of gc… version 6.6
configure: WARNING: You seem to be running an outdated version of the Garbage Collector.
configure: WARNING: An upgrade to a version >= 7.0 is recommended.
configure: WARNING: See the "Memory Managment" section of INSTALL for details.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License