~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to config/ac-macros/maintainer.m4

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Control aspects of the development environment which are
 
3
# specific to MySQL maintainers and developers.
 
4
#
 
5
AC_DEFUN([MY_MAINTAINER_MODE], [
 
6
  AC_MSG_CHECKING([whether to enable the maintainer-specific development environment])
 
7
  AC_ARG_ENABLE([mysql-maintainer-mode],
 
8
    [AS_HELP_STRING([--enable-mysql-maintainer-mode],
 
9
                    [Enable a MySQL maintainer-specific development environment])],
 
10
    [USE_MYSQL_MAINTAINER_MODE=$enableval],
 
11
    [AS_IF([test "$with_debug" != "no"],
 
12
      [USE_MYSQL_MAINTAINER_MODE=yes], [USE_MYSQL_MAINTAINER_MODE=no])])
 
13
  AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE])
 
14
])
 
15
 
 
16
# Set warning options required under maintainer mode.
 
17
AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
 
18
  # Detect ICC posing as GCC.
 
19
  AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
 
20
               [INTEL_COMPILER=no], [INTEL_COMPILER=yes])
 
21
  # Setup GCC warning options.
 
22
  AS_IF([test "$GCC" = "yes" -a "$INTEL_COMPILER" = "no"], [
 
23
    C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
 
24
    CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
 
25
    C_WARNINGS="${C_WARNINGS} -Wdeclaration-after-statement"
 
26
  ])
 
27
 
 
28
  # Test whether the warning options work.
 
29
  # Test C options
 
30
  AS_IF([test -n "$C_WARNINGS"], [
 
31
    save_CFLAGS="$CFLAGS"
 
32
    AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}])
 
33
    AC_LANG_PUSH(C)
 
34
    CFLAGS="$CFLAGS ${C_WARNINGS}"
 
35
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes],
 
36
                      [myac_c_warning_flags=no])
 
37
    AC_LANG_POP()
 
38
    AC_MSG_RESULT([$myac_c_warning_flags])
 
39
    CFLAGS="$save_CFLAGS"
 
40
  ])
 
41
 
 
42
  # Test C++ options
 
43
  AS_IF([test -n "$CXX_WARNINGS"], [
 
44
    save_CXXFLAGS="$CXXFLAGS"
 
45
    AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}])
 
46
    AC_LANG_PUSH(C++)
 
47
    CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}"
 
48
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes],
 
49
                      [myac_cxx_warning_flags=no])
 
50
    AC_LANG_POP()
 
51
    AC_MSG_RESULT([$myac_cxx_warning_flags])
 
52
    CXXFLAGS="$save_CXXFLAGS"
 
53
  ])
 
54
 
 
55
  # Set compile flag variables.
 
56
  AS_IF([test "$myac_c_warning_flags" = "yes"], [
 
57
    AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}"
 
58
    AC_SUBST([AM_CFLAGS])])
 
59
  AS_IF([test "$myac_cxx_warning_flags" = "yes"], [
 
60
    AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}"
 
61
    AC_SUBST([AM_CXXFLAGS])])
 
62
])
 
63
 
 
64
 
 
65
# Set compiler flags required under maintainer mode.
 
66
AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [
 
67
  AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"],
 
68
        [MY_MAINTAINER_MODE_WARNINGS])
 
69
])