summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-11-04 17:08:26 +0100
committerSimo Sorce <ssorce@redhat.com>2010-11-22 16:01:35 -0500
commitce75d1c6d6595bcb26dbacf7393098a8f9accb3f (patch)
treeb5296adcad725d4b543fa566e906c2ed711054d9
parent5da451876e76fa8bfc04a537d30c2d3c5ef84841 (diff)
downloadfreeipa-ce75d1c6d6595bcb26dbacf7393098a8f9accb3f.tar.gz
freeipa-ce75d1c6d6595bcb26dbacf7393098a8f9accb3f.tar.xz
freeipa-ce75d1c6d6595bcb26dbacf7393098a8f9accb3f.zip
Stricter compilation flags
Use a little stricter compilation flags, in particular -Wall and treat implicit function declarations as errors. Signed-off-by: Simo Sorce <ssorce@redhat.com>
-rw-r--r--daemons/Makefile.am8
-rw-r--r--daemons/configure.ac2
-rw-r--r--daemons/ipa-kpasswd/Makefile.am1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-uuid/Makefile.am1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-version/Makefile.am1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-winsync/Makefile.am1
-rw-r--r--ipa-client/Makefile.am9
-rw-r--r--ipa-client/configure.ac2
11 files changed, 28 insertions, 0 deletions
diff --git a/daemons/Makefile.am b/daemons/Makefile.am
index 9960789a4..7b2b99746 100644
--- a/daemons/Makefile.am
+++ b/daemons/Makefile.am
@@ -4,6 +4,14 @@ AUTOMAKE_OPTIONS = 1.7
NULL =
+AM_CFLAGS = $(NULL)
+if HAVE_GCC
+ AM_CFLAGS += -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith \
+ -Wcast-align -Werror-implicit-function-declaration \
+ $(NULL)
+endif
+export AM_CFLAGS
+
SUBDIRS = \
ipa-kpasswd \
ipa-slapi-plugins \
diff --git a/daemons/configure.ac b/daemons/configure.ac
index 53806f52d..da86557d2 100644
--- a/daemons/configure.ac
+++ b/daemons/configure.ac
@@ -16,6 +16,8 @@ AC_PROG_LIBTOOL
AC_HEADER_STDC
+AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes])
+
AC_SUBST(VERSION)
dnl ---------------------------------------------------------------------------
diff --git a/daemons/ipa-kpasswd/Makefile.am b/daemons/ipa-kpasswd/Makefile.am
index ce241ca06..40e8c58f0 100644
--- a/daemons/ipa-kpasswd/Makefile.am
+++ b/daemons/ipa-kpasswd/Makefile.am
@@ -8,6 +8,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
+ $(AM_CFLAGS) \
$(OPENLDAP_CFLAGS) \
$(KRB5_CFLAGS) \
$(WARN_CFLAGS) \
diff --git a/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am b/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
index fc3c55cca..d041815a2 100644
--- a/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
+ $(AM_CFLAGS) \
$(MOZLDAP_CFLAGS) \
$(KRB5_CFLAGS) \
$(WARN_CFLAGS) \
diff --git a/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am b/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
index 3b0ff6297..b79868748 100644
--- a/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
@@ -12,6 +12,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
+ $(AM_CFLAGS) \
$(MOZLDAP_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
index 3577e48cc..6f6092d20 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
+ $(AM_CFLAGS) \
$(MOZLDAP_CFLAGS) \
$(KRB5_CFLAGS) \
$(SSL_CFLAGS) \
diff --git a/daemons/ipa-slapi-plugins/ipa-uuid/Makefile.am b/daemons/ipa-slapi-plugins/ipa-uuid/Makefile.am
index 1e5d97937..7c3709b5a 100644
--- a/daemons/ipa-slapi-plugins/ipa-uuid/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-uuid/Makefile.am
@@ -12,6 +12,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
+ $(AM_CFLAGS) \
$(MOZLDAP_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
diff --git a/daemons/ipa-slapi-plugins/ipa-version/Makefile.am b/daemons/ipa-slapi-plugins/ipa-version/Makefile.am
index f90543ee4..d26a7d24e 100644
--- a/daemons/ipa-slapi-plugins/ipa-version/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-version/Makefile.am
@@ -13,6 +13,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
+ $(AM_CFLAGS) \
$(MOZLDAP_CFLAGS) \
$(KRB5_CFLAGS) \
$(WARN_CFLAGS) \
diff --git a/daemons/ipa-slapi-plugins/ipa-winsync/Makefile.am b/daemons/ipa-slapi-plugins/ipa-winsync/Makefile.am
index 79c37becb..82a934a22 100644
--- a/daemons/ipa-slapi-plugins/ipa-winsync/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-winsync/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
+ $(AM_CFLAGS) \
$(MOZLDAP_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
diff --git a/ipa-client/Makefile.am b/ipa-client/Makefile.am
index 2fc45be25..655a68664 100644
--- a/ipa-client/Makefile.am
+++ b/ipa-client/Makefile.am
@@ -4,6 +4,14 @@ AUTOMAKE_OPTIONS = 1.7
NULL =
+AM_CFLAGS = $(NULL)
+if HAVE_GCC
+ AM_CFLAGS += -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith \
+ -Wcast-align -Werror-implicit-function-declaration \
+ $(NULL)
+endif
+export AM_CFLAGS
+
INCLUDES = \
-I. \
-I$(srcdir) \
@@ -13,6 +21,7 @@ INCLUDES = \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DLOCALEDIR=\""$(localedir)"\" \
+ $(AM_CFLAGS) \
$(KRB5_CFLAGS) \
$(OPENLDAP_CFLAGS) \
$(MOZLDAP_CFLAGS) \
diff --git a/ipa-client/configure.ac b/ipa-client/configure.ac
index bfa77cefa..95becd352 100644
--- a/ipa-client/configure.ac
+++ b/ipa-client/configure.ac
@@ -19,6 +19,8 @@ AC_DISABLE_STATIC
AC_HEADER_STDC
+AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes])
+
AC_SUBST(VERSION)
dnl ---------------------------------------------------------------------------