From 4f78f8cf5031b75edbe348c24fc4d870dddc1d1e Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Wed, 28 Dec 2005 14:07:04 +0000 Subject: [PATCH] Only use -Wall and gcc-only flags with gcc. 2005-12-28 Tollef Fog Heen * configure.in, Makefile.am: Only use -Wall and other gcc-only flags when we don't have a set of CFLAGS already set and we're using gcc. Freedesktop #4888. --- ChangeLog | 6 ++++++ Makefile.am | 2 +- configure.in | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 94d8a2b..2787525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-12-28 Tollef Fog Heen + + * configure.in, Makefile.am: Only use -Wall and other gcc-only + flags when we don't have a set of CFLAGS already set and we're + using gcc. Freedesktop #4888. + 2005-10-17 Tollef Fog Heen * pkg.m4: Do AC_MSG_RESULT([no]) even if $4 is set (so we don't diff --git a/Makefile.am b/Makefile.am index ee81bb4..4fcde30 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,7 @@ man_MANS = pkg-config.1 EXTRA_DIST = $(m4_DATA) $(man_MANS) README.win32 bin_PROGRAMS = pkg-config -AM_CFLAGS=-g -Wall -O2 +AM_CFLAGS=@WARN_CFLAGS@ INCLUDES=-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" $(included_glib_includes) diff --git a/configure.in b/configure.in index 3d7437d..5432289 100644 --- a/configure.in +++ b/configure.in @@ -58,6 +58,16 @@ or auto]) esac AC_MSG_RESULT($use_indirect_deps) +# +# Choose default CFLAGS and warnings depending on compiler. +# + +WARN_CFLAGS="" +if test "${GCC}" = "yes" && test "${ac_env_CFLAGS_set}" != "set"; then + WARN_CFLAGS="-g -Wall -O2" +fi +AC_SUBST(WARN_CFLAGS) + AC_DEFINE_UNQUOTED(ENABLE_INDIRECT_DEPS, `test $use_indirect_deps = no; echo $?`, [Link library to all dependent libraries, not only directly needed ones]) AC_MSG_CHECKING([for Win32]) -- 2.39.5