* Makefiles : -Werror option moved abrt.spec -Wall -Wwrite-strings moved to configure.ac (default options)
* configure.ac : Remove 'silent-rule' from AM_INIT_AUTOMAKE and use AM_SILENT_RULES macro with argument 'yes' to make build of libreport silent by default. Those who want verbose build output may configure with --disable-silent-rules or use "make V=1".
Signed-off-by: Jakub Filak jfilak@redhat.com --- abrt.spec.in | 3 +-- configure.ac | 13 +++++++++---- src/applet/Makefile.am | 6 ++---- src/cli/Makefile.am | 3 +-- src/daemon/Makefile.am | 13 ++++--------- src/dbus/Makefile.am | 4 +--- src/gui-gtk/Makefile.am | 6 ++---- src/hooks/Makefile.am | 2 -- src/lib/Makefile.am | 1 - src/plugins/Makefile.am | 39 +++++++++++++-------------------------- 10 files changed, 33 insertions(+), 57 deletions(-)
diff --git a/abrt.spec.in b/abrt.spec.in index a79d809..972ce92 100644 --- a/abrt.spec.in +++ b/abrt.spec.in @@ -236,8 +236,7 @@ uses PolicyKit to authorize to access the problem data.
%build autoconf -%configure -CFLAGS="-fno-strict-aliasing" +CFLAGS="%{optflags} -Werror" %configure --disable-silent-rules make %{?_smp_mflags}
%install diff --git a/configure.ac b/configure.ac index a51cf4f..bb2b986 100644 --- a/configure.ac +++ b/configure.ac @@ -3,8 +3,13 @@ AC_INIT([abrt], [crash-catcher@fedorahosted.org])
AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign silent-rules]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +# Support silent build rules. Disable by either passing --disable-silent-rules +# to ./configure or passing V=1 to make m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) +# The 'yes' argument is undocumented but it is common knowledge that it works. +AM_SILENT_RULES([yes]) +
AC_DISABLE_STATIC AC_PROG_LIBTOOL @@ -13,12 +18,12 @@ AC_PROG_LN_S
AC_SYS_LARGEFILE CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ - -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -std=gnu99 -Wall" + -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -std=gnu99 -Wall -Wwrite-strings"
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [Enable debug information])], - [CFLAGS="$CFLAGS -DDEBUG -ggdb -g"]) + [CFLAGS="$CFLAGS -DDEBUG -ggdb -g -O0"])
dnl ****** INTERNATIONALIZATION ********************** GETTEXT_PACKAGE=abrt @@ -114,7 +119,7 @@ AC_CONFIG_TESTDIR(tests) AC_CONFIG_FILES([tests/Makefile tests/atlocal]) AM_MISSING_PROG([AUTOM4TE], [autom4te]) # Needed by tests/atlocal.in. -AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`]) +AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//' | sed 's/-Werror//'`])
AC_CONFIG_HEADERS([config.h])
diff --git a/src/applet/Makefile.am b/src/applet/Makefile.am index 28bd769..d11951b 100644 --- a/src/applet/Makefile.am +++ b/src/applet/Makefile.am @@ -11,8 +11,7 @@ abrt_applet_CPPFLAGS = \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ $(LIBREPORT_GTK_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE # -I/usr/include/glib-2.0 # -I/usr/lib/glib-2.0/include # $(LIBNOTIFY_CFLAGS) @@ -32,8 +31,7 @@ abrt_applet_LDADD = \ #test_report_CPPFLAGS = \ # -I$(srcdir)/../include/report -I$(srcdir)/../include \ # $(GLIB_CFLAGS) \ -# -D_GNU_SOURCE \ -# -Wall -Wwrite-strings -Werror +# -D_GNU_SOURCE #test_report_LDADD = \ # ../lib/libreport.la
diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am index 1524312..5b39353 100644 --- a/src/cli/Makefile.am +++ b/src/cli/Makefile.am @@ -14,8 +14,7 @@ abrt_cli_SOURCES = $(CLI_C) $(BUILTIN_C) builtin-cmd.h abrt-cli-core.h abrt_cli_CFLAGS = \ -I$(srcdir)/../include \ -I$(srcdir)/../lib \ - $(LIBREPORT_CFLAGS) \ - -Wwrite-strings -Werror + $(LIBREPORT_CFLAGS)
abrt_cli_LDADD = \ $(LIBREPORT_LIBS) \ diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index 90187d4..2e24403 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -24,9 +24,7 @@ abrtd_CPPFLAGS = \ -DLIBEXEC_DIR="$(libexecdir)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings \ - -Werror + -D_GNU_SOURCE abrtd_LDADD = \ ../lib/libabrt.la \ $(LIBREPORT_LIBS) @@ -38,8 +36,7 @@ abrt_server_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_server_LDADD = \ ../lib/libabrt.la \ $(LIBREPORT_LIBS) @@ -52,8 +49,7 @@ abrt_handle_event_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(BTPARSER_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_handle_event_LDADD = \ ../lib/libabrt.la \ $(LIBREPORT_LIBS) \ @@ -68,8 +64,7 @@ abrt_action_save_package_data_CPPFLAGS = \ -DCONF_DIR="$(CONF_DIR)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_save_package_data_LDADD = \ $(RPM_LIBS) \ $(LIBREPORT_LIBS) \ diff --git a/src/dbus/Makefile.am b/src/dbus/Makefile.am index 5f29c71..5b4b7fc 100644 --- a/src/dbus/Makefile.am +++ b/src/dbus/Makefile.am @@ -13,9 +13,7 @@ abrt_dbus_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(POLKIT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings \ - -Werror + -D_GNU_SOURCE abrt_dbus_LDADD = \ $(GIO_LIBS) \ ../lib/libabrt.la \ diff --git a/src/gui-gtk/Makefile.am b/src/gui-gtk/Makefile.am index 76fa731..270ad1b 100644 --- a/src/gui-gtk/Makefile.am +++ b/src/gui-gtk/Makefile.am @@ -12,8 +12,7 @@ abrt_gui_CFLAGS = \ $(GTK_CFLAGS) \ $(LIBREPORT_GTK_CFLAGS) \ -D_GNU_SOURCE \ - $(GIO_CFLAGS) \ - -Wall -Wwrite-strings -Werror + $(GIO_CFLAGS) # -I/usr/include/glib-2.0 # -I/usr/lib/glib-2.0/include # $(LIBNOTIFY_CFLAGS) @@ -32,8 +31,7 @@ abrt_gui_LDADD = \ #test_report_CPPFLAGS = \ # -I$(srcdir)/../include/report -I$(srcdir)/../include \ # $(GLIB_CFLAGS) \ -# -D_GNU_SOURCE \ -# -Wall -Wwrite-strings -Werror +# -D_GNU_SOURCE #test_report_LDADD = \ # ../lib/libreport.la
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am index f232779..bbdc472 100644 --- a/src/hooks/Makefile.am +++ b/src/hooks/Makefile.am @@ -20,8 +20,6 @@ abrt_hook_ccpp_CPPFLAGS = \ -DPLUGINS_CONF_DIR="$(PLUGINS_CONF_DIR)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -Wall -Wwrite-strings \ - -Werror \ -D_GNU_SOURCE abrt_hook_ccpp_LDADD = \ ../lib/libabrt.la \ diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index f7019ff..fbf784d 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -15,7 +15,6 @@ libabrt_la_SOURCES = \ problem_api.c
libabrt_la_CPPFLAGS = \ - -Wall -Wwrite-strings -Werror \ -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DVAR_RUN="$(VAR_RUN)" \ diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index bb96c6f..0f8a4d4 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -80,8 +80,7 @@ abrt_watch_log_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_watch_log_LDADD = \ $(GLIB_LIBS) \ $(LIBREPORT_LIBS) \ @@ -94,8 +93,7 @@ abrt_dump_oops_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_dump_oops_LDADD = \ $(GLIB_LIBS) \ $(LIBREPORT_LIBS) \ @@ -108,8 +106,7 @@ abrt_dump_xorg_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_dump_xorg_LDADD = \ $(GLIB_LIBS) \ $(LIBREPORT_LIBS) \ @@ -122,8 +119,7 @@ abrt_action_analyze_c_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_analyze_c_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la @@ -135,8 +131,7 @@ abrt_action_analyze_python_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_analyze_python_LDADD = \ $(LIBREPORT_LIBS)
@@ -148,8 +143,7 @@ abrt_action_analyze_oops_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_analyze_oops_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la @@ -161,8 +155,7 @@ abrt_action_trim_files_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_trim_files_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la @@ -176,8 +169,7 @@ abrt_action_generate_backtrace_CPPFLAGS = \ -DPLUGINS_CONF_DIR="$(PLUGINS_CONF_DIR)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_generate_backtrace_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la @@ -191,8 +183,7 @@ abrt_action_generate_core_backtrace_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(BTPARSER_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_generate_core_backtrace_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS) \ @@ -206,8 +197,7 @@ abrt_action_analyze_backtrace_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(BTPARSER_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_action_analyze_backtrace_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS) @@ -233,8 +223,7 @@ abrt_retrace_client_SOURCES = \ $(NSS_CFLAGS) \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - $(LIBREPORT_CFLAGS) \ - -Wall -Wwrite-strings -Werror + $(LIBREPORT_CFLAGS) abrt_retrace_client_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS) \ @@ -249,8 +238,7 @@ abrt_dedup_client_SOURCES = \ $(NSS_CFLAGS) \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - $(LIBREPORT_CFLAGS) \ - -Wall -Wwrite-strings -Werror + $(LIBREPORT_CFLAGS) abrt_dedup_client_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS) \ @@ -266,8 +254,7 @@ abrt_bodhi_SOURCES = \ $(LIBREPORT_WEB_CFLAGS) \ $(JSON_C_CFLAGS) \ $(RPM_CFLAGS) \ - -D_GNU_SOURCE \ - -Wall -Wwrite-strings -Werror + -D_GNU_SOURCE abrt_bodhi_LDADD = \ $(JSON_C_LIBS) \ $(RPM_LIBS) \
Signed-off-by: Jakub Filak jfilak@redhat.com --- .gitignore | 1 + src/hooks/Makefile.am | 9 +++- src/hooks/abrt-install-ccpp-hook | 97 ------------------------------------- src/hooks/abrt-install-ccpp-hook.in | 97 +++++++++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 98 deletions(-) delete mode 100755 src/hooks/abrt-install-ccpp-hook create mode 100755 src/hooks/abrt-install-ccpp-hook.in
diff --git a/.gitignore b/.gitignore index 4982416..8d6aeca 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ src/plugins/abrt-action-generate-core-backtrace src/plugins/abrt-bodhi src/hooks/abrt_exception_handler.py src/hooks/abrt-hook-ccpp +src/hooks/abrt-install-ccpp-hook src/applet/abrt-applet.desktop src/gui-gtk/abrt.desktop src/cli/abrt-cli diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am index bbdc472..3cfaabd 100644 --- a/src/hooks/Makefile.am +++ b/src/hooks/Makefile.am @@ -26,7 +26,9 @@ abrt_hook_ccpp_LDADD = \ $(LIBREPORT_LIBS)
python_PYTHON = abrt.pth abrt_exception_handler.py -EXTRA_DIST = abrt_exception_handler.py.in abrt-install-ccpp-hook abrt-harvest-vmcore +EXTRA_DIST = abrt_exception_handler.py.in \ + abrt-install-ccpp-hook.in \ + abrt-harvest-vmcore
CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *#)) $(notdir $(wildcard .#*)) $(notdir $(wildcard *.pyc)) $(man1_MANS)
@@ -44,3 +46,8 @@ install-data-local: sed -e s,@VAR_RUN@,"$(VAR_RUN)",g \ -e s,@CONF_DIR@,"$(CONF_DIR)",g \ abrt_exception_handler.py.in >abrt_exception_handler.py + +abrt-install-ccpp-hook: abrt-install-ccpp-hook.in + sed -e s,@VAR_RUN@,$(VAR_RUN),g \ + -e s,@libexecdir@,$(libexecdir),g \ + $< >$@ diff --git a/src/hooks/abrt-install-ccpp-hook b/src/hooks/abrt-install-ccpp-hook deleted file mode 100755 index 63fc804..0000000 --- a/src/hooks/abrt-install-ccpp-hook +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# Install coredump handler which saves segfault data - -# For debugging - -dry_run=false -verbose=false - -PATTERN_FILE="/proc/sys/kernel/core_pattern" -SAVED_PATTERN_DIR="/var/run/abrt" -SAVED_PATTERN_FILE="/var/run/abrt/saved_core_pattern" -HOOK_BIN="/usr/libexec/abrt-hook-ccpp" -# Must match percent_specifiers[] order in abrt-hook-ccpp.c: -PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e" -# Same, but with bogus "executable name" parameter -PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e" - -# core_pipe_limit specifies how many dump_helpers can run at the same time -# 0 - means unlimited, but it's not guaranteed that /proc/<pid> of crashing -# process will be available for dump_helper. -# 4 - means that 4 dump_helpers can run at the same time (the rest will also -# run, but they will fail to read /proc/<pid>). -# -# This should be enough for ABRT, we can miss some crashes, but what are -# the odds that more processes crash at the same time? And moreover, -# do people want to save EVERY ONE of the crashes when they have -# a crash storm? I don't think so. -# The value of 4 has been recommended by nhorman. -# -CORE_PIPE_LIMIT_FILE="/proc/sys/kernel/core_pipe_limit" -CORE_PIPE_LIMIT="4" - -start() { - cur=`cat "$PATTERN_FILE"` - cur_first=`printf "%s" "$cur" | sed 's/ .*//'` - - # Is there a %e (executable name) in old pattern anywhere? - if test x"${cur#*%e}" = x"${cur}"; then - # No. Can use PATTERN with less risk of overflow - # on expansion (executable names can be LONG). - # Overflow would cause kernel to abort coredump. BAD. - PATTERN="$PATTERN1" - fi - - $verbose && printf "cur:'%s'\n" "$cur" - # Is it already installed? - if test x"$cur_first" != x"|$HOOK_BIN"; then # no - # It is not installed - mkdir -p -- "$SAVED_PATTERN_DIR" - printf "%s\n" "$cur" >"$SAVED_PATTERN_FILE" - # Install new handler - $verbose && printf "Installing to %s:'%s'\n" "$PATTERN_FILE" "$PATTERN" - $dry_run || echo "$PATTERN" >"$PATTERN_FILE" - - # Check core_pipe_limit and change it if it's 0, - # otherwise the abrt-hook-ccpp won't be able to read /proc/<pid> - # of the crashing process - if test x"`cat "$CORE_PIPE_LIMIT_FILE"`" = x"0"; then - echo "$CORE_PIPE_LIMIT" >"$CORE_PIPE_LIMIT_FILE" - fi - fi -} - -stop() { - if test -f "$SAVED_PATTERN_FILE"; then - $verbose && printf "Restoring to %s:'%s'\n" "$PATTERN_FILE" "`cat "$SAVED_PATTERN_FILE"`" - $dry_run || cat "$SAVED_PATTERN_FILE" >"$PATTERN_FILE" - fi -} - -status() { - cur=`cat "$PATTERN_FILE"` - cur_first=`printf "%s" "$cur" | sed 's/ .*//'` - # Is it already installed? - if test x"$cur_first" = x"|$HOOK_BIN"; then # yes - $verbose && printf "Installed\n" - return 0 - else - $verbose && printf "Not installed\n" - return 1 - fi -} - -case "$1" in -install) - start - ;; -uninstall) - stop - ;; -is-installed) - status - ;; -*) - echo $"Usage: $0 {install|uninstall|is-installed}" - exit 2 -esac diff --git a/src/hooks/abrt-install-ccpp-hook.in b/src/hooks/abrt-install-ccpp-hook.in new file mode 100755 index 0000000..aa01231 --- /dev/null +++ b/src/hooks/abrt-install-ccpp-hook.in @@ -0,0 +1,97 @@ +#!/bin/bash +# Install coredump handler which saves segfault data + +# For debugging + +dry_run=false +verbose=false + +PATTERN_FILE="/proc/sys/kernel/core_pattern" +SAVED_PATTERN_DIR="@VAR_RUN@/abrt" +SAVED_PATTERN_FILE="@VAR_RUN@/abrt/saved_core_pattern" +HOOK_BIN="@libexecdir@/abrt-hook-ccpp" +# Must match percent_specifiers[] order in abrt-hook-ccpp.c: +PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e" +# Same, but with bogus "executable name" parameter +PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e" + +# core_pipe_limit specifies how many dump_helpers can run at the same time +# 0 - means unlimited, but it's not guaranteed that /proc/<pid> of crashing +# process will be available for dump_helper. +# 4 - means that 4 dump_helpers can run at the same time (the rest will also +# run, but they will fail to read /proc/<pid>). +# +# This should be enough for ABRT, we can miss some crashes, but what are +# the odds that more processes crash at the same time? And moreover, +# do people want to save EVERY ONE of the crashes when they have +# a crash storm? I don't think so. +# The value of 4 has been recommended by nhorman. +# +CORE_PIPE_LIMIT_FILE="/proc/sys/kernel/core_pipe_limit" +CORE_PIPE_LIMIT="4" + +start() { + cur=`cat "$PATTERN_FILE"` + cur_first=`printf "%s" "$cur" | sed 's/ .*//'` + + # Is there a %e (executable name) in old pattern anywhere? + if test x"${cur#*%e}" = x"${cur}"; then + # No. Can use PATTERN with less risk of overflow + # on expansion (executable names can be LONG). + # Overflow would cause kernel to abort coredump. BAD. + PATTERN="$PATTERN1" + fi + + $verbose && printf "cur:'%s'\n" "$cur" + # Is it already installed? + if test x"$cur_first" != x"|$HOOK_BIN"; then # no + # It is not installed + mkdir -p -- "$SAVED_PATTERN_DIR" + printf "%s\n" "$cur" >"$SAVED_PATTERN_FILE" + # Install new handler + $verbose && printf "Installing to %s:'%s'\n" "$PATTERN_FILE" "$PATTERN" + $dry_run || echo "$PATTERN" >"$PATTERN_FILE" + + # Check core_pipe_limit and change it if it's 0, + # otherwise the abrt-hook-ccpp won't be able to read /proc/<pid> + # of the crashing process + if test x"`cat "$CORE_PIPE_LIMIT_FILE"`" = x"0"; then + echo "$CORE_PIPE_LIMIT" >"$CORE_PIPE_LIMIT_FILE" + fi + fi +} + +stop() { + if test -f "$SAVED_PATTERN_FILE"; then + $verbose && printf "Restoring to %s:'%s'\n" "$PATTERN_FILE" "`cat "$SAVED_PATTERN_FILE"`" + $dry_run || cat "$SAVED_PATTERN_FILE" >"$PATTERN_FILE" + fi +} + +status() { + cur=`cat "$PATTERN_FILE"` + cur_first=`printf "%s" "$cur" | sed 's/ .*//'` + # Is it already installed? + if test x"$cur_first" = x"|$HOOK_BIN"; then # yes + $verbose && printf "Installed\n" + return 0 + else + $verbose && printf "Not installed\n" + return 1 + fi +} + +case "$1" in +install) + start + ;; +uninstall) + stop + ;; +is-installed) + status + ;; +*) + echo $"Usage: $0 {install|uninstall|is-installed}" + exit 2 +esac
- ACK to both
On 08/06/2012 10:30 AM, Jakub Filak wrote:
Makefiles : -Werror option moved abrt.spec -Wall -Wwrite-strings moved to configure.ac (default options)
configure.ac : Remove 'silent-rule' from AM_INIT_AUTOMAKE and use AM_SILENT_RULES macro with argument 'yes' to make build of libreport silent by default. Those who want verbose build output may configure with --disable-silent-rules or use "make V=1".
Signed-off-by: Jakub Filak jfilak@redhat.com
abrt.spec.in | 3 +-- configure.ac | 13 +++++++++---- src/applet/Makefile.am | 6 ++---- src/cli/Makefile.am | 3 +-- src/daemon/Makefile.am | 13 ++++--------- src/dbus/Makefile.am | 4 +--- src/gui-gtk/Makefile.am | 6 ++---- src/hooks/Makefile.am | 2 -- src/lib/Makefile.am | 1 - src/plugins/Makefile.am | 39 +++++++++++++-------------------------- 10 files changed, 33 insertions(+), 57 deletions(-)
diff --git a/abrt.spec.in b/abrt.spec.in index a79d809..972ce92 100644 --- a/abrt.spec.in +++ b/abrt.spec.in @@ -236,8 +236,7 @@ uses PolicyKit to authorize to access the problem data.
%build autoconf -%configure -CFLAGS="-fno-strict-aliasing" +CFLAGS="%{optflags} -Werror" %configure --disable-silent-rules make %{?_smp_mflags}
%install diff --git a/configure.ac b/configure.ac index a51cf4f..bb2b986 100644 --- a/configure.ac +++ b/configure.ac @@ -3,8 +3,13 @@ AC_INIT([abrt], [crash-catcher@fedorahosted.org])
AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign silent-rules]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +# Support silent build rules. Disable by either passing --disable-silent-rules +# to ./configure or passing V=1 to make m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) +# The 'yes' argument is undocumented but it is common knowledge that it works. +AM_SILENT_RULES([yes])
AC_DISABLE_STATIC AC_PROG_LIBTOOL
@@ -13,12 +18,12 @@ AC_PROG_LN_S
AC_SYS_LARGEFILE CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -std=gnu99 -Wall"
-D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -std=gnu99 -Wall -Wwrite-strings"
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [Enable debug information])],
[CFLAGS="$CFLAGS -DDEBUG -ggdb -g"])
[CFLAGS="$CFLAGS -DDEBUG -ggdb -g -O0"])
dnl ****** INTERNATIONALIZATION ********************** GETTEXT_PACKAGE=abrt
@@ -114,7 +119,7 @@ AC_CONFIG_TESTDIR(tests) AC_CONFIG_FILES([tests/Makefile tests/atlocal]) AM_MISSING_PROG([AUTOM4TE], [autom4te]) # Needed by tests/atlocal.in. -AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`]) +AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//' | sed 's/-Werror//'`])
AC_CONFIG_HEADERS([config.h])
diff --git a/src/applet/Makefile.am b/src/applet/Makefile.am index 28bd769..d11951b 100644 --- a/src/applet/Makefile.am +++ b/src/applet/Makefile.am @@ -11,8 +11,7 @@ abrt_applet_CPPFLAGS = \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ $(LIBREPORT_GTK_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE # -I/usr/include/glib-2.0 # -I/usr/lib/glib-2.0/include # $(LIBNOTIFY_CFLAGS)
@@ -32,8 +31,7 @@ abrt_applet_LDADD = \ #test_report_CPPFLAGS = \ # -I$(srcdir)/../include/report -I$(srcdir)/../include \ # $(GLIB_CFLAGS) \ -# -D_GNU_SOURCE \ -# -Wall -Wwrite-strings -Werror +# -D_GNU_SOURCE #test_report_LDADD = \ # ../lib/libreport.la
diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am index 1524312..5b39353 100644 --- a/src/cli/Makefile.am +++ b/src/cli/Makefile.am @@ -14,8 +14,7 @@ abrt_cli_SOURCES = $(CLI_C) $(BUILTIN_C) builtin-cmd.h abrt-cli-core.h abrt_cli_CFLAGS = \ -I$(srcdir)/../include \ -I$(srcdir)/../lib \
- $(LIBREPORT_CFLAGS) \
- -Wwrite-strings -Werror
$(LIBREPORT_CFLAGS)
abrt_cli_LDADD = \ $(LIBREPORT_LIBS) \
diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index 90187d4..2e24403 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -24,9 +24,7 @@ abrtd_CPPFLAGS = \ -DLIBEXEC_DIR="$(libexecdir)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings \
- -Werror
- -D_GNU_SOURCE abrtd_LDADD = \ ../lib/libabrt.la \ $(LIBREPORT_LIBS)
@@ -38,8 +36,7 @@ abrt_server_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_server_LDADD = \ ../lib/libabrt.la \ $(LIBREPORT_LIBS)
@@ -52,8 +49,7 @@ abrt_handle_event_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(BTPARSER_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_handle_event_LDADD = \ ../lib/libabrt.la \ $(LIBREPORT_LIBS) \
@@ -68,8 +64,7 @@ abrt_action_save_package_data_CPPFLAGS = \ -DCONF_DIR="$(CONF_DIR)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_save_package_data_LDADD = \ $(RPM_LIBS) \ $(LIBREPORT_LIBS) \
diff --git a/src/dbus/Makefile.am b/src/dbus/Makefile.am index 5f29c71..5b4b7fc 100644 --- a/src/dbus/Makefile.am +++ b/src/dbus/Makefile.am @@ -13,9 +13,7 @@ abrt_dbus_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(POLKIT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings \
- -Werror
- -D_GNU_SOURCE abrt_dbus_LDADD = \ $(GIO_LIBS) \ ../lib/libabrt.la \
diff --git a/src/gui-gtk/Makefile.am b/src/gui-gtk/Makefile.am index 76fa731..270ad1b 100644 --- a/src/gui-gtk/Makefile.am +++ b/src/gui-gtk/Makefile.am @@ -12,8 +12,7 @@ abrt_gui_CFLAGS = \ $(GTK_CFLAGS) \ $(LIBREPORT_GTK_CFLAGS) \ -D_GNU_SOURCE \
- $(GIO_CFLAGS) \
- -Wall -Wwrite-strings -Werror
- $(GIO_CFLAGS) # -I/usr/include/glib-2.0 # -I/usr/lib/glib-2.0/include # $(LIBNOTIFY_CFLAGS)
@@ -32,8 +31,7 @@ abrt_gui_LDADD = \ #test_report_CPPFLAGS = \ # -I$(srcdir)/../include/report -I$(srcdir)/../include \ # $(GLIB_CFLAGS) \ -# -D_GNU_SOURCE \ -# -Wall -Wwrite-strings -Werror +# -D_GNU_SOURCE #test_report_LDADD = \ # ../lib/libreport.la
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am index f232779..bbdc472 100644 --- a/src/hooks/Makefile.am +++ b/src/hooks/Makefile.am @@ -20,8 +20,6 @@ abrt_hook_ccpp_CPPFLAGS = \ -DPLUGINS_CONF_DIR="$(PLUGINS_CONF_DIR)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -Wall -Wwrite-strings \
- -Werror \ -D_GNU_SOURCE abrt_hook_ccpp_LDADD = \ ../lib/libabrt.la \
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index f7019ff..fbf784d 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -15,7 +15,6 @@ libabrt_la_SOURCES = \ problem_api.c
libabrt_la_CPPFLAGS = \
- -Wall -Wwrite-strings -Werror \ -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DVAR_RUN="$(VAR_RUN)" \
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index bb96c6f..0f8a4d4 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -80,8 +80,7 @@ abrt_watch_log_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_watch_log_LDADD = \ $(GLIB_LIBS) \ $(LIBREPORT_LIBS) \
@@ -94,8 +93,7 @@ abrt_dump_oops_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_dump_oops_LDADD = \ $(GLIB_LIBS) \ $(LIBREPORT_LIBS) \
@@ -108,8 +106,7 @@ abrt_dump_xorg_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_dump_xorg_LDADD = \ $(GLIB_LIBS) \ $(LIBREPORT_LIBS) \
@@ -122,8 +119,7 @@ abrt_action_analyze_c_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_analyze_c_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la
@@ -135,8 +131,7 @@ abrt_action_analyze_python_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_analyze_python_LDADD = \ $(LIBREPORT_LIBS)
@@ -148,8 +143,7 @@ abrt_action_analyze_oops_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_analyze_oops_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la
@@ -161,8 +155,7 @@ abrt_action_trim_files_CPPFLAGS = \ -I$(srcdir)/../lib \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_trim_files_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la
@@ -176,8 +169,7 @@ abrt_action_generate_backtrace_CPPFLAGS = \ -DPLUGINS_CONF_DIR="$(PLUGINS_CONF_DIR)" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_generate_backtrace_LDADD = \ $(LIBREPORT_LIBS) \ ../lib/libabrt.la
@@ -191,8 +183,7 @@ abrt_action_generate_core_backtrace_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(BTPARSER_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_generate_core_backtrace_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS) \
@@ -206,8 +197,7 @@ abrt_action_analyze_backtrace_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(BTPARSER_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_action_analyze_backtrace_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS)
@@ -233,8 +223,7 @@ abrt_retrace_client_SOURCES = \ $(NSS_CFLAGS) \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \
$(LIBREPORT_CFLAGS) \
-Wall -Wwrite-strings -Werror
abrt_retrace_client_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS) \$(LIBREPORT_CFLAGS)
@@ -249,8 +238,7 @@ abrt_dedup_client_SOURCES = \ $(NSS_CFLAGS) \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \
$(LIBREPORT_CFLAGS) \
-Wall -Wwrite-strings -Werror
abrt_dedup_client_LDADD = \ $(LIBREPORT_LIBS) \ $(BTPARSER_LIBS) \$(LIBREPORT_CFLAGS)
@@ -266,8 +254,7 @@ abrt_bodhi_SOURCES = \ $(LIBREPORT_WEB_CFLAGS) \ $(JSON_C_CFLAGS) \ $(RPM_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
- -D_GNU_SOURCE abrt_bodhi_LDADD = \ $(JSON_C_LIBS) \ $(RPM_LIBS) \
crash-catcher@lists.fedorahosted.org