Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • m4/acx_compilerflags.m4

    • Property mode changed from 120000 to 100644
    ra19da5d rcc2ee5  
    1 ../../m4/acx_compilerflags.m4
     1# AC_SET_COMPILER_FLAGS(optimization, debugging, warnings)
     2#----------------------------------------------------------------
     3AC_DEFUN([AC_SET_COMPILER_FLAGS],[
     4AC_MSG_NOTICE([Using AC@&t@_SET_COMPILER_FLAGS macro])
     5
     6dnl optimization
     7if test ! x"$1" = xno; then
     8        if test x"$2" = xno; then
     9                if test x"$1" = xyes; then
     10                        optimization="-O2"
     11                else
     12                        optimization="-O$1"
     13                fi
     14        fi
     15fi
     16dnl debugging info
     17if ! test x"$2" = xno; then
     18        if test x"$2" = xyes; then
     19                debugging="-g3"
     20        else
     21                debugging="-g$2"
     22        fi
     23  AC_DEFINE(HAVE_DEBUG,1, ["Output debugging info"])
     24  AC_SUBST(HAVE_DEBUG)
     25fi
     26
     27dnl enable all warnings
     28if test x"$3" = xsome; then
     29        dnl even without debugging we want some minimal info of something's utterly wrong
     30        Cwarnings="-Wall"
     31        CXXwarnings="-Wall"
     32fi
     33if test x"$3" = xfull; then
     34        Cwarnings="-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wredundant-decls -Wnested-externs -Wmissing-noreturn -Wformat-security -Wmissing-format-attribute -Winit-self"
     35        CXXwarnings="-Wall -W -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wredundant-decls -Wmissing-noreturn -Wformat-security -Wmissing-format-attribute -Winit-self"
     36fi
     37if test x"$3" = xnone; then
     38        unset Cwarnings
     39        unset CXXwarnings
     40else
     41        AC_DEFINE(HAVE_WARNINGS,$enable_warnings, ["Output compiler warnings"])
     42fi
     43
     44# finally, apply whatever was set
     45CFLAGS="$CFLAGS $debugging $optimization $Cwarnings"
     46CXXFLAGS="$CXXFLAGS $debugging $optimization $CXXwarnings"
     47
     48])
Note: See TracChangeset for help on using the changeset viewer.