Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

build: Add some more warnings and a debug mode

  • Loading branch information...
commit 8f5ca731ed30e72b08d35a63722ef7772992e961 1 parent 9bf2735
Jens Georg authored

Showing 3 changed files with 19 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  autogen.sh
  2. +17 0 configure.ac
  3. +1 1  dbus/Makefile.am
2  autogen.sh
@@ -9,4 +9,4 @@ ${GDBUS_CODEGEN} --generate-c-code dbus/korva-dbus-interface \
9 9 --interface-prefix org.jensge.Korva \
10 10 data/Korva.xml
11 11
12   -autoreconf -if && ./configure $*
  12 +autoreconf -if && ./configure --enable-debug $*
17 configure.ac
@@ -17,8 +17,25 @@ AC_PROG_CC
17 17 AC_PROG_RANLIB
18 18 AM_PROG_CC_C_O
19 19
  20 +CFLAGS="${CFLAGS} -Wall -Wextra -Wno-unused-parameter"
  21 +CFLAGS="${CFLAGS} -Wno-missing-field-initializers -Wmissing-declarations"
  22 +CFLAGS="${CFLAGS} -Wshadow -Wredundant-decls -Wmissing-noreturn"
  23 +CFLAGS="${CFLAGS} -Wpointer-arith -Wwrite-strings -Winline -Wformat-nonliteral"
  24 +CFLAGS="${CFLAGS} -Wcast-align -Wformat-security -Wswitch-enum"
  25 +CFLAGS="${CFLAGS} -Wswitch-default"
  26 +
20 27 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.30 gio-unix-2.0 >= 2.30])
21 28 PKG_CHECK_MODULES([GUPNP], [gupnp-1.0 >= 0.18.0 gupnp-av-1.0 >= 0.10.1])
  29 +
  30 +AC_ARG_ENABLE([debug],
  31 + AS_HELP_STRING([--enable-debug],[Enable debug build]),[],
  32 + [enable_debug=no])
  33 +if test "x$enable_debug" = "xyes"; then
  34 + CFLAGS="${CFLAGS} -O0 -g -Werror"
  35 +else
  36 + CFLAGS="${CFLAGS} -O2"
  37 +fi
  38 +
22 39 AC_CONFIG_FILES([
23 40 Makefile
24 41 dbus/Makefile
2  dbus/Makefile.am
... ... @@ -1,3 +1,3 @@
1 1 lib_LIBRARIES=libkorva-dbus.a
2 2 libkorva_dbus_a_SOURCES = korva-dbus-interface.c korva-dbus-interface.h
3   -libkorva_dbus_a_CFLAGS = $(GIO_CFLAGS) -I $(srcdir)/..
  3 +libkorva_dbus_a_CFLAGS = $(GIO_CFLAGS) -I $(srcdir)/.. -w

0 comments on commit 8f5ca73

Please sign in to comment.
Something went wrong with that request. Please try again.