~ubuntu-branches/ubuntu/trusty/gq/trusty

« back to all changes in this revision

Viewing changes to macros/herzi-cflags.m4

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2009-10-25 23:34:56 UTC
  • mfrom: (1.1.4 upstream) (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091025233456-i794n3yg2cff930j
Tags: 1.3.4-1
* QA upload.
  + Set maintainer to Debian QA Group <packages@qa.debian.org>.
* New upstream release. (Closes: #534705).
  + Does not segfault on amd64. (Closes: #444312).
  + Remove all existing patches and change patch system to quilt.
  + Replace dpatch build-dep with quilt.
* 01_desktop_file.diff - Remove encoding and bogus categories 
  from desktop file.
* Copy in config.{sub,guess} on configure, rm them on clean.
  + Add build-dep on autotools-dev.
* Make clean not ignore errors.
* Add copyright holders and version path to GPL (GPL-2).
* Update watch file to use SF redirector. (Closes: #449749).
* Bump debhelper build-dep and compat to 5.
* Bump Standards Version to 3.8.3.
  + Menu policy transition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# herzi-cflags.m4
 
2
#
 
3
# File that contains autoconf macros that perfom checks with modified CFLAGS
 
4
# and CPPFLAGS
 
5
 
 
6
dnl HERZI_CHECK_HEADER([header.h],[action if succ],[action if fail],[include],[extra_flags])
 
7
AC_DEFUN([HERZI_CHECK_HEADER],[
 
8
        HERZI_SAVE_CFLAGS="$CFLAGS"
 
9
        HERZI_SAVE_CPPFLAGS="$CPPFLAGS"
 
10
        CFLAGS="$CFLAGS $5"
 
11
        CPPFLAGS="$CPPFLAGS $5"
 
12
 
 
13
        AC_CHECK_HEADER([$1],[$2],[$3],[$4])
 
14
        
 
15
        CFLAGS="$HERZI_SAVE_CFLAGS"
 
16
        CPPFLAGS="$HERZI_SAVE_CPPFLAGS"
 
17
])
 
18
 
 
19
dnl HERZI_TRY_COMPILE([header.h],[action if succ],[action if fail],[include],[extra_flags])
 
20
AC_DEFUN([HERZI_TRY_COMPILE],[
 
21
        HERZI_SAVE_CFLAGS="$CFLAGS"
 
22
        HERZI_SAVE_CPPFLAGS="$CPPFLAGS"
 
23
        CFLAGS="$CFLAGS $6"
 
24
        CPPFLAGS="$CPPFLAGS $6"
 
25
 
 
26
        AC_TRY_COMPILE([$1],[$2],[$3],[$4],[$5])
 
27
        
 
28
        CFLAGS="$HERZI_SAVE_CFLAGS"
 
29
        CPPFLAGS="$HERZI_SAVE_CPPFLAGS"
 
30
])
 
31
 
 
32
dnl HERZI_CHECK_CFLAGS("new cflags to try")
 
33
AC_DEFUN([HERZI_CHECK_CFLAGS],[
 
34
        HERZI_CFLAGS=""
 
35
 
 
36
        AC_CHECK_PROGS(XARGS,[xargs],no)
 
37
        if test $XARGS = no; then
 
38
                AC_MSG_ERROR([Couldn't find xargs, please install xargs])
 
39
        fi
 
40
 
 
41
        for option in `echo $1 | $XARGS echo`; do
 
42
                AC_MSG_CHECKING([whether $CC understands $option])
 
43
                HERZI_TRY_COMPILE([],[],has_option=yes,has_option=no,[],[$option])
 
44
                
 
45
                if test $has_option = yes; then
 
46
                    HERZI_CFLAGS="$HERZI_CFLAGS $option"
 
47
                fi
 
48
                AC_MSG_RESULT($has_option)
 
49
        done
 
50
 
 
51
        CFLAGS="$CFLAGS $HERZI_CFLAGS"
 
52
])
 
53
 
 
54
dnl HERZI_CHECK_DEVELOP_CFLAGS
 
55
AC_DEFUN([HERZI_CHECK_DEVELOP_CFLAGS],[
 
56
        HERZI_CHECK_CFLAGS("-W -Wall -Wno-uninitialized -Wfloat-equal \
 
57
                            -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
 
58
                            -Wnested-externs -Wpointer-arith -Winit-self \
 
59
                            -Wcast-align -Wsign-compare -Wuninitialized \
 
60
                            -Wno-strict-aliasing -Wnested-externs -Wpointer-arith \
 
61
                            -Werror-implicit-function-declaration -Wswitch -g")
 
62
])
 
63