~ubuntu-branches/ubuntu/warty/gedit/warty-security

« back to all changes in this revision

Viewing changes to macros/compiler-flags.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2004-10-10 21:24:57 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041010212457-f7q85htgynmslwf4
Tags: 2.8.1-0ubuntu1
* New upstream release:
  - do not try to open non regular files.
  - allow opening file by drag and drop on read only documents.
  - open dropped files in the right target gedit window.
  - do not change active document when closing an unmodified tab.
  - fix crash when trying to open an invalid sftp uri.
* debian/patches/01_relibtoolise.patch:
  - removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl GNOME_COMPILE_WARNINGS
2
 
dnl Turn on many useful compiler warnings
3
 
dnl For now, only works on GCC
4
 
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
5
 
  AC_ARG_ENABLE(compile-warnings, 
6
 
    [  --enable-compile-warnings=[no/minimum/yes]       Turn on compiler warnings.],,enable_compile_warnings=minimum)
7
 
 
8
 
  AC_MSG_CHECKING(what warning flags to pass to the C compiler)
9
 
  warnCFLAGS=
10
 
  if test "x$GCC" != xyes; then
11
 
    enable_compile_warnings=no
12
 
  fi
13
 
 
14
 
  if test "x$enable_compile_warnings" != "xno"; then
15
 
    if test "x$GCC" = "xyes"; then
16
 
      case " $CFLAGS " in
17
 
      *[\ \     ]-Wall[\ \      ]*) ;;
18
 
      *) warnCFLAGS="-Wall -Wunused" ;;
19
 
      esac
20
 
 
21
 
      ## -W is not all that useful.  And it cannot be controlled
22
 
      ## with individual -Wno-xxx flags, unlike -Wall
23
 
      if test "x$enable_compile_warnings" = "xyes"; then
24
 
        warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations"
25
 
      fi
26
 
    fi
27
 
  fi
28
 
  AC_MSG_RESULT($warnCFLAGS)
29
 
 
30
 
  AC_ARG_ENABLE(iso-c,
31
 
    [  --enable-iso-c          Try to warn if code is not ISO C ],,
32
 
    enable_iso_c=no)
33
 
 
34
 
  AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
35
 
  complCFLAGS=
36
 
  if test "x$enable_iso_c" != "xno"; then
37
 
    if test "x$GCC" = "xyes"; then
38
 
      case " $CFLAGS " in
39
 
      *[\ \     ]-ansi[\ \      ]*) ;;
40
 
      *) complCFLAGS="$complCFLAGS -ansi" ;;
41
 
      esac
42
 
 
43
 
      case " $CFLAGS " in
44
 
      *[\ \     ]-pedantic[\ \  ]*) ;;
45
 
      *) complCFLAGS="$complCFLAGS -pedantic" ;;
46
 
      esac
47
 
    fi
48
 
  fi
49
 
  AC_MSG_RESULT($complCFLAGS)
50
 
  if test "x$cflags_set" != "xyes"; then
51
 
    CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
52
 
    cflags_set=yes
53
 
    AC_SUBST(cflags_set)
54
 
  fi
55
 
])
56
 
 
57
 
dnl For C++, do basically the same thing.
58
 
 
59
 
AC_DEFUN([GNOME_CXX_WARNINGS],[
60
 
  AC_ARG_ENABLE(cxx-warnings, 
61
 
    [  --enable-cxx-warnings=[no/minimum/yes]   Turn on compiler warnings.],,enable_cxx_warnings=minimum)
62
 
 
63
 
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
64
 
  warnCXXFLAGS=
65
 
  if test "x$GCC" != xyes; then
66
 
    enable_compile_warnings=no
67
 
  fi
68
 
  if test "x$enable_cxx_warnings" != "xno"; then
69
 
    if test "x$GCC" = "xyes"; then
70
 
      case " $CXXFLAGS " in
71
 
      *[\ \     ]-Wall[\ \      ]*) ;;
72
 
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
73
 
      esac
74
 
 
75
 
      ## -W is not all that useful.  And it cannot be controlled
76
 
      ## with individual -Wno-xxx flags, unlike -Wall
77
 
      if test "x$enable_cxx_warnings" = "xyes"; then
78
 
        warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual"
79
 
      fi
80
 
    fi
81
 
  fi
82
 
  AC_MSG_RESULT($warnCXXFLAGS)
83
 
 
84
 
   AC_ARG_ENABLE(iso-cxx,
85
 
     [  --enable-iso-cxx          Try to warn if code is not ISO C++ ],,
86
 
     enable_iso_cxx=no)
87
 
 
88
 
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
89
 
   complCXXFLAGS=
90
 
   if test "x$enable_iso_cxx" != "xno"; then
91
 
     if test "x$GCC" = "xyes"; then
92
 
      case " $CXXFLAGS " in
93
 
      *[\ \     ]-ansi[\ \      ]*) ;;
94
 
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
95
 
      esac
96
 
 
97
 
      case " $CXXFLAGS " in
98
 
      *[\ \     ]-pedantic[\ \  ]*) ;;
99
 
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
100
 
      esac
101
 
     fi
102
 
   fi
103
 
  AC_MSG_RESULT($complCXXFLAGS)
104
 
  if test "x$cxxflags_set" != "xyes"; then
105
 
    CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
106
 
    cxxflags_set=yes
107
 
    AC_SUBST(cxxflags_set)
108
 
  fi
109
 
])