* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / m4 / annotations.m4
1 dnl m4/annotations.m4
2 dnl
3 dnl Copyright (C) 2007, 2008
4 dnl CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 dnl 
6 dnl This file is part of CACAO.
7 dnl 
8 dnl This program is free software; you can redistribute it and/or
9 dnl modify it under the terms of the GNU General Public License as
10 dnl published by the Free Software Foundation; either version 2, or (at
11 dnl your option) any later version.
12 dnl 
13 dnl This program is distributed in the hope that it will be useful, but
14 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 dnl General Public License for more details.
17 dnl 
18 dnl You should have received a copy of the GNU General Public License
19 dnl along with this program; if not, write to the Free Software
20 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 dnl 02110-1301, USA.
22
23
24 dnl check if annotations support should be built
25
26 AC_DEFUN([AC_CHECK_ENABLE_ANNOTATIONS],[
27 AC_MSG_CHECKING(wether to build annotations support)
28 AC_ARG_ENABLE([annotations],
29               [AS_HELP_STRING(--enable-annotations,build annotations support [[default=(cldc1.1:no,javase:yes]])],
30               [case "${enableval}" in
31                    yes)
32                        ENABLE_ANNOTATIONS=yes
33                        ;;
34                    no)
35                        ENABLE_ANNOTATIONS=no
36                        ;;
37                    *)
38                        AC_CHECK_ENABLE_ANNOTATIONS_DEFAULT
39                        ;;
40                esac],
41               [AC_CHECK_ENABLE_ANNOTATIONS_DEFAULT])
42 AC_MSG_RESULT(${ENABLE_ANNOTATIONS})
43 AM_CONDITIONAL([ENABLE_ANNOTATIONS], test x"${ENABLE_ANNOTATIONS}" = "xyes")
44    
45 if test x"${ENABLE_ANNOTATIONS}" = "xyes"; then
46     AC_DEFINE([ENABLE_ANNOTATIONS], 1, [enable annotations])
47 fi
48 ])
49
50
51 dnl check for the default value for --enable-annotations
52
53 AC_DEFUN([AC_CHECK_ENABLE_ANNOTATIONS_DEFAULT],[
54 if test x"${ENABLE_JAVAME_CLDC1_1}" = "xyes"; then
55     ENABLE_ANNOTATIONS=no
56 else
57     ENABLE_ANNOTATIONS=yes
58 fi
59 ])