source: npl/mailserver/dspam/dspam-3.10.2/m4/gcc_build_options.m4

Last change on this file was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 3.0 KB
Line 
1dnl $Id: gcc_build_options.m4,v 1.1 2004/10/24 20:48:37 jonz Exp $
2dnl gcc_build_options.m4
3dnl
4
5AC_DEFUN([GCC_BUILD_OPTIONS],
6[
7
8if test x$GCC = xyes
9then
10
11#
12# Enable Compiler Warnings
13#
14
15AC_ARG_ENABLE(warnings,
16[[  --enable-warnings[={no|[{yes|error}][,proto]}]
17                          Disable (no) or enable (yes) more warnings
18                          or enable and treat warnings as errors (error).
19                          Simple --enable-warnings is the same
20                          as --enable-warnings=yes.
21                          You can add ',proto' to 'yes' or 'error' option
22                          for turning on additional '-Wstrict-prototypes'
23                          flag.
24                          Have effect for GCC compilers only.
25  --disable-warnings      Same as --enable-warnings=no [default]]])
26                                                                               
27    gcc_param=",$enable_warnings,"
28    gcc_enable_warnings=`echo $gcc_param|grep ',no,' >/dev/null 2>&1 && echo no || echo yes`
29    gcc_enable_error=`echo $gcc_param|grep ',error,' >/dev/null 2>&1 && echo yes || echo no`
30    gcc_enable_strict_proto=`echo $gcc_param|grep ',proto,' >/dev/null 2>&1 && echo yes || echo no`
31                                                                               
32        warn_flags='-Wall -Wmissing-prototypes -Wmissing-declarations'
33                                                                               
34    if test x$gcc_enable_strict_proto != xno
35    then
36        warn_flags="$warn_flags -Wstrict-prototypes"
37    fi
38                                                                               
39    if test x$gcc_enable_error != xno
40    then
41        warn_flags="$warn_flags -Werror"
42    fi
43                                                                               
44    if test x$gcc_enable_warnings != xno
45    then
46        CFLAGS="$CFLAGS $warn_flags"
47        CXXFLAGS="$CXXFLAGS $warn_flags"
48    fi
49
50#
51#   Enable Profiling Support
52#
53AC_ARG_ENABLE(profiling,
54    [AS_HELP_STRING(--enable-profiling,
55                       Disable (no) or enable (yes) performance profiling.
56                          Generate extra code to write profile information
57                          suitable for the analysis program gprof.
58                          Has effect for GCC compilers only.
59                    )])
60AC_MSG_CHECKING([whether to enable profiling output])
61case x"$enable_profiling" in
62    xyes)   # profiling output enabled explicity
63            ;;
64    xno)    # profiling output disabled explicity
65            ;;
66    x)      # profiling output disabled by default
67            enable_profiling=no
68            ;;
69    *)      AC_MSG_ERROR([unexpected value $enable_profiling for --{enable,disable}-profiling configure option])
70            ;;
71esac
72if test x"$enable_profiling" != xyes
73then
74    enable_profiling=no
75else
76    enable_profiling=yes    # overkill, but convenient
77     CFLAGS="$CFLAGS -pg"
78     CXXFLAGS="$CXXFLAGS -pg"
79fi
80AC_MSG_RESULT([$enable_profiling])
81
82# GCC
83fi
84
85])
86
Note: See TracBrowser for help on using the repository browser.