From c36581bc01fc8891ea43d4c455961bb39ea54904 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 31 Oct 2011 20:30:06 -0400 Subject: Add --enable-debug configure option. --- configure.ac | 13 ++++++++++++- libdimension-python/Makefile.am | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bafc63e..5652aff 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,7 @@ AC_ARG_ENABLE([png], if test "$enable_png" != "no"; then PKG_CHECK_MODULES([libpng], [libpng], [enable_png=yes], [test "$enable_png" = "yes" && AC_MSG_ERROR([libpng not found]) - enable_png-no]) + enable_png=no]) AC_SUBST(libpng_CFLAGS) AC_SUBST(libpng_LIBS) fi @@ -76,6 +76,17 @@ AC_ARG_ENABLE([profile], [enable_profile=no]) AM_CONDITIONAL([PROFILE], [test "$enable_profile" = "yes"]) +dnl Debug/release builds +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [Perform potentially expensive sanity checks while running [default=no]])], + [], + [enable_debug=no]) +if test "$enable_debug" = "no"; then + AC_DEFINE([NDEBUG], [1]) +fi +AM_CONDITIONAL([DEBUG], [test "$enable_debug" = "yes"]) + dnl Python headers PKG_CHECK_MODULES([Python], [python3 >= 3.2], [], diff --git a/libdimension-python/Makefile.am b/libdimension-python/Makefile.am index 33e93a5..6e76591 100644 --- a/libdimension-python/Makefile.am +++ b/libdimension-python/Makefile.am @@ -26,7 +26,11 @@ AM_CFLAGS = $(Python_CFLAGS) AM_LDFLAGS = $(Python_LDFLAGS) wrapper.c: wrapper.pyx wrapper.pxd +if DEBUG cython --line-directives wrapper.pyx +else + cython wrapper.pyx +endif pkgpyexec_LTLIBRARIES = wrapper.la wrapper_la_SOURCES = wrapper.c \ -- cgit v1.2.3