summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_dbus_bindings/Makefile.am17
-rw-r--r--_dbus_glib_bindings/Makefile.am19
-rw-r--r--configure.ac40
-rw-r--r--test/Makefile.am26
4 files changed, 65 insertions, 37 deletions
diff --git a/_dbus_bindings/Makefile.am b/_dbus_bindings/Makefile.am
index 42c9f91..e0610c9 100644
--- a/_dbus_bindings/Makefile.am
+++ b/_dbus_bindings/Makefile.am
@@ -1,9 +1,18 @@
pyexec_LTLIBRARIES = _dbus_bindings.la
-AM_CPPFLAGS = -I$(top_srcdir)/include $(DBUS_CFLAGS) $(PYTHON_INCLUDES)
-AM_LDFLAGS = -module -avoid-version \
- -export-symbols-regex \(PyInit__\|init_\)dbus_bindings \
- $(NULL)
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ $(DBUS_CFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(NULL)
+AM_CFLAGS = \
+ $(WARN_CFLAGS) \
+ $(NULL)
+AM_LDFLAGS = \
+ -module -avoid-version \
+ -export-symbols-regex \(PyInit__\|init_\)dbus_bindings \
+ $(WARN_LDFLAGS) \
+ $(NULL)
libadd = $(DBUS_LIBS)
diff --git a/_dbus_glib_bindings/Makefile.am b/_dbus_glib_bindings/Makefile.am
index ead49da..b4c8715 100644
--- a/_dbus_glib_bindings/Makefile.am
+++ b/_dbus_glib_bindings/Makefile.am
@@ -1,10 +1,19 @@
pyexec_LTLIBRARIES = _dbus_glib_bindings.la
-AM_CPPFLAGS = -I$(top_srcdir)/include $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) \
- $(PYTHON_INCLUDES)
-AM_LDFLAGS = -module -avoid-version \
- -export-symbols-regex \(PyInit__\|init_\)dbus_glib_bindings \
- $(NULL)
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ $(DBUS_CFLAGS) \
+ $(DBUS_GLIB_CFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(NULL)
+AM_CFLAGS = \
+ $(WARN_CFLAGS) \
+ $(NULL)
+AM_LDFLAGS = \
+ -module -avoid-version \
+ -export-symbols-regex \(PyInit__\|init_\)dbus_glib_bindings \
+ $(WARN_LDFLAGS) \
+ $(NULL)
libadd = \
$(DBUS_LIBS) \
diff --git a/configure.ac b/configure.ac
index 43d0c8b..c4bdee4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,27 +172,25 @@ AM_CONDITIONAL([ENABLE_DOCS], [test "$enable_html_docs" != no])
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6])
PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.70])
-TP_COMPILER_WARNINGS([CFLAGS_WARNINGS], [test] dbus_python_released [= 0],
- [all \
- extra \
- declaration-after-statement \
- deprecated-declarations \
- shadow \
- strict-prototypes \
- missing-prototypes \
- missing-declarations \
- sign-compare \
- nested-externs \
- pointer-arith \
- format-security \
- init-self],
- [missing-field-initializers \
- unused-parameter])
-
-JH_ADD_CFLAG([-std=c9x])
-JH_ADD_CFLAG([-fno-strict-aliasing])
-
-CFLAGS="$CFLAGS $CFLAGS_WARNINGS"
+AX_COMPILER_FLAGS([WARN_CFLAGS],
+ [WARN_LDFLAGS],
+ [ifelse(dbus_python_released, [1], [yes], [no])],
+ dnl unfortunately the Python headers fail various checks included in
+ dnl AX_COMPILER_FLAGS, and are not const-correct for strings
+ [ \
+ -Wdeprecated-declarations \
+ -Wno-redundant-decls \
+ -Wno-switch-default \
+ -Wno-write-strings \
+ -std=c9x \
+ ])
+dnl AX_COMPILER_FLAGS doesn't order the compiler flags correctly to be able
+dnl to disable flags that it would normally enable
+WARN_CFLAGS="$(echo "${WARN_CFLAGS}" | ${SED} \
+ -e s/-Wredundant-decls// \
+ -e s/-Wswitch-default// \
+ -e s/-Wwrite-strings// \
+ )"
ifelse(dbus_python_released, 1,
[ # version x.y.z - disable coding style checks by default
diff --git a/test/Makefile.am b/test/Makefile.am
index f4bc6e5..a37b57d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -26,12 +26,24 @@ pyexec_LTLIBRARIES = dbus_py_test.la
install:
@echo "Not installing anything from test/"
-dbus_py_test_la_CPPFLAGS = -I$(top_srcdir)/include $(DBUS_CFLAGS) \
- $(PYTHON_INCLUDES)
-dbus_py_test_la_LDFLAGS = -module -avoid-version \
- $(DBUS_LIBS)
-dbus_py_test_la_SOURCES = dbus_py_test.c \
- $(top_srcdir)/include/dbus-python.h
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ $(DBUS_CFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(NULL)
+AM_CFLAGS = \
+ $(WARN_CFLAGS) \
+ $(NULL)
+AM_LDFLAGS = \
+ -module \
+ -avoid-version \
+ $(WARN_LDFLAGS) \
+ $(NULL)
+
+dbus_py_test_la_LIBADD = $(DBUS_LIBS)
+dbus_py_test_la_SOURCES = \
+ dbus_py_test.c \
+ $(top_srcdir)/include/dbus-python.h
AM_TESTS_ENVIRONMENT = \
export DBUS_TOP_SRCDIR="$(abs_top_srcdir)"; \
@@ -47,7 +59,7 @@ check_PROGRAMS = test-import-repeatedly
test_import_repeatedly_SOURCES = import-repeatedly.c
test_import_repeatedly_CPPFLAGS = $(PYTHON_INCLUDES)
-test_import_repeatedly_LDFLAGS = $(PYTHON_LIBS)
+test_import_repeatedly_LDADD = $(PYTHON_LIBS)
cross-test-server:
$(AM_TESTS_ENVIRONMENT) $(PYTHON) $(top_srcdir)/test/cross-test-server.py