diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..840f88b --- /dev/null +++ b/acinclude.m4 | |||
@@ -0,0 +1,34 @@ | |||
1 | dnl This file is part of GNU mailutils. | ||
2 | dnl Copyright (C) 2001 Free Software Foundation, Inc. | ||
3 | dnl | ||
4 | dnl This file is free software; as a special exception the author gives | ||
5 | dnl unlimited permission to copy and/or distribute it, with or without | ||
6 | dnl modifications, as long as this notice is preserved. | ||
7 | dnl | ||
8 | dnl This program is distributed in the hope that it will be useful, but | ||
9 | dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the | ||
10 | dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
11 | dnl | ||
12 | dnl Check for --enable-debug switch. When the switch is specified, add | ||
13 | dnl -ggdb to CFLAGS and remove any optimization options from there. | ||
14 | dnl | ||
15 | |||
16 | AC_DEFUN([MU_DEBUG_MODE], | ||
17 | [AC_ARG_ENABLE(debug, | ||
18 | [ --enable-debug enable debugging mode], | ||
19 | [if test x"$enableval" = xyes; then | ||
20 | if test x"$GCC" = xyes; then | ||
21 | AC_MSG_CHECKING(whether gcc accepts -ggdb) | ||
22 | save_CFLAGS=$CFLAGS | ||
23 | CFLAGS="-ggdb -Wall" | ||
24 | AC_TRY_COMPILE([],void f(){}, | ||
25 | AC_MSG_RESULT(yes), | ||
26 | [if test x"$ac_cv_prog_cc_g" = xyes; then | ||
27 | CFLAGS="-g -Wall" | ||
28 | else | ||
29 | CFLAGS= | ||
30 | fi | ||
31 | AC_MSG_RESULT(no)]) | ||
32 | CFLAGS="`echo $save_CFLAGS | sed 's/-O[[0-9]]//g'` $CFLAGS" | ||
33 | fi | ||
34 | fi])]) | ||