diff --git a/Makefile.am b/Makefile.am index dbf42d14..c97ae938 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,7 @@ applications_DATA = htop.desktop pixmapdir = $(datadir)/pixmaps pixmap_DATA = htop.png -AM_CFLAGS += -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)" +AM_CFLAGS += -pedantic -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)" AM_LDFLAGS = AM_CPPFLAGS = -DNDEBUG diff --git a/configure.ac b/configure.ac index 12676fa3..f22490f5 100644 --- a/configure.ac +++ b/configure.ac @@ -85,26 +85,13 @@ AC_CHECK_FUNCS([memmove strncasecmp strstr strdup]) save_cflags="${CFLAGS}" CFLAGS="${CFLAGS} -std=c99" -AC_MSG_CHECKING([whether gcc -std=c99 option works]) +AC_MSG_CHECKING([whether cc -std=c99 option works]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[char *a; a = strdup("foo"); int i = 0; i++; // C99]])], [AC_MSG_RESULT([yes])], - [AC_MSG_ERROR([htop is written in C99. A newer version of gcc is required.])]) + [AC_MSG_ERROR([htop is written in C99. A newer compiler is required.])]) CFLAGS="$save_cflags" -save_cflags="${CFLAGS}" -CFLAGS="$CFLAGS -Wextra" -AC_MSG_CHECKING([if compiler supports -Wextra]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],[ - wextra_flag=-Wextra - AC_MSG_RESULT([yes]) -],[ - wextra_flag= - AC_MSG_RESULT([no]) -]) -CFLAGS="$save_cflags" -AC_SUBST(wextra_flag) - # Checks for features and flags. # ---------------------------------------------------------------------- PROCDIR=/proc @@ -279,6 +266,19 @@ then ]) fi +AM_CFLAGS="\ + -Wall\ + -Wcast-align\ + -Wextra\ + -Wmissing-format-attribute\ + -Wmissing-noreturn\ + -Wpointer-arith\ + -Wshadow\ + -Wstrict-prototypes\ + -Wundef\ + -Wunused\ + -Wwrite-strings" + AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [Treat warnings as errors (default: warnings are not errors)])], [enable_werror="$enableval"], [enable_werror=no]) AS_IF([test "x$enable_werror" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -Werror"]) AC_SUBST([AM_CFLAGS])