* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / m4 / gc.m4
1 dnl m4/gc.m4
2 dnl
3 dnl Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
4 dnl C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 dnl E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 dnl J. Wenninger, Institut f. Computersprachen - TU Wien
7 dnl 
8 dnl This file is part of CACAO.
9 dnl 
10 dnl This program is free software; you can redistribute it and/or
11 dnl modify it under the terms of the GNU General Public License as
12 dnl published by the Free Software Foundation; either version 2, or (at
13 dnl your option) any later version.
14 dnl 
15 dnl This program is distributed in the hope that it will be useful, but
16 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 dnl General Public License for more details.
19 dnl 
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with this program; if not, write to the Free Software
22 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 dnl 02110-1301, USA.
24
25
26 dnl check for garbage collector usage
27
28 AC_DEFUN([AC_CHECK_ENABLE_GC],[
29 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--enable-gc,enable garbage collector support (none,boehm,cacao) [[default=boehm]])])
30 AC_MSG_CHECKING(whether GC should be enabled)
31 enable_gc=${enable_gc:-boehm}
32 case "$enable_gc" in
33 no | none)
34     AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
35     ENABLE_GC=none
36     AC_MSG_RESULT(no)
37     ;;
38
39 boehm)
40     AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
41     ENABLE_GC=boehm
42     AC_MSG_RESULT(yes, boehm-gc)
43     ;;
44
45 cacao)
46     AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
47     ENABLE_GC=cacao
48     AC_MSG_RESULT(yes, cacao-gc)
49     ;;
50
51 *)
52     AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
53     ;;
54 esac
55 AM_CONDITIONAL([DISABLE_GC], test x"${ENABLE_GC}" = "xnone")
56 AM_CONDITIONAL([ENABLE_GC_BOEHM], test x"${ENABLE_GC}" = "xboehm")
57 AM_CONDITIONAL([ENABLE_GC_CACAO], test x"${ENABLE_GC}" = "xcacao")
58 ])