Index: CodePatterns-debug.pc.in
===================================================================
--- CodePatterns-debug.pc.in	(revision cdf2e4b35fbdd7c3205205e770e338e51473ef11)
+++ CodePatterns-debug.pc.in	(revision cdf2e4b35fbdd7c3205205e770e338e51473ef11)
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: CodePatterns - various design schemes and helpers to initial application development, with debug compiled in
+Version: @PACKAGE_VERSION@
+URL: @PACKAGE_URL@
+Libs: -L${libdir} -lCodePatterns-debug
+Cflags: -I${includedir} -DMEMDEBUG
+##Requires: boost_thread >= 1.4.0
+Libs.private: -ldl
Index: configure.ac
===================================================================
--- configure.ac	(revision 70672e3033fd826be8f117a9bb9d43e660dda95e)
+++ configure.ac	(revision cdf2e4b35fbdd7c3205205e770e338e51473ef11)
@@ -3,5 +3,5 @@
 
 AC_PREREQ([2.65])
-AC_INIT([CodePatterns], [1.0.0], [heber@ins.uni-bonn.de], [codepatterns], [http://trac.ins.uni-bonn.de/projects/CodePatterns/])
+AC_INIT([CodePatterns], [1.0.1], [heber@ins.uni-bonn.de], [codepatterns], [http://trac.ins.uni-bonn.de/projects/CodePatterns/])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_SRCDIR([src/Patterns/Singleton_impl.hpp])
@@ -25,6 +25,6 @@
 # refer to the libtool manual, section "Updating library version information":
 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
-AC_SUBST([CODEPATTERNS_SO_VERSION], [1:0:0])
-AC_SUBST([CODEPATTERNS_API_VERSION], [1.0.0])
+AC_SUBST([CODEPATTERNS_SO_VERSION], [1:0:1])
+AC_SUBST([CODEPATTERNS_API_VERSION], [1.0.1])
 
 # Checks for libraries.
@@ -50,4 +50,6 @@
   CodePatterns.pc:CodePatterns.pc.in])
 AC_CONFIG_FILES([
+  CodePatterns-debug.pc:CodePatterns-debug.pc.in])
+AC_CONFIG_FILES([
 	Makefile
 	doc/Makefile
Index: m4/ax_codepatterns.m4
===================================================================
--- m4/ax_codepatterns.m4	(revision 70672e3033fd826be8f117a9bb9d43e660dda95e)
+++ m4/ax_codepatterns.m4	(revision cdf2e4b35fbdd7c3205205e770e338e51473ef11)
@@ -1,4 +1,4 @@
 dnl
-dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [no]debug, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 dnl
 
@@ -15,4 +15,5 @@
 
   codepatterns_version_min=$1
+  codepatterns_debug=$2
 
   CodePatterns_CFLAGS=""
@@ -27,13 +28,15 @@
   fi
   # 1. test whether pkg-config works
-  CodePatterns_CONFIG=""
+  CodePatterns_CONFIG="no"
   #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH])
-  PKG_CHECK_MODULES([CodePatterns], [CodePatterns >= $codepatterns_version_min], [
+  if test x$codepatterns_debug != x0; then
+    codepatterns_libname="CodePatterns-debug"
+    PKG_CHECK_MODULES([CodePatterns_debug], [CodePatterns >= $codepatterns_version_min], [
       codepatterns_pkgconfig=yes
-      CodePatterns_CONFIG="pkg-config CodePatterns"
+      CodePatterns_CONFIG="pkg-config $codepatterns_libname"
     ], [
     # 2. if failed, test for binary codepatterns-config
       AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no)
-      if test x$CodePatterns_CONFIG = xno && test x$codepatterns_prefix != x ; then
+      if test "x$CodePatterns_CONFIG" = xno && test x$codepatterns_prefix != x ; then
         if test -e $codepatterns_prefix/bin/codepatterns-config; then
           codepatterns_pkgconfig=no
@@ -41,9 +44,26 @@
         fi
       fi
-    ]
-  )
+    ])
+
+  else
+    codepatterns_libname="CodePatterns"
+    PKG_CHECK_MODULES([CodePatterns], [CodePatterns >= $codepatterns_version_min], [
+      codepatterns_pkgconfig=yes
+      CodePatterns_CONFIG="pkg-config $codepatterns_libname"
+    ], [
+    # 2. if failed, test for binary codepatterns-config
+      AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no)
+      if test "x$CodePatterns_CONFIG" = xno && test x$codepatterns_prefix != x ; then
+        if test -e $codepatterns_prefix/bin/codepatterns-config; then
+          codepatterns_pkgconfig=no
+          CodePatterns_CONFIG="$codepatterns_prefix/bin/codepatterns-config"
+        fi
+      fi
+    ])
+
+  fi
 
   # try to set values via CodePatterns_CONFIG
-  if test ! -z "$CodePatterns_CONFIG"; then 
+  if test "x$CodePatterns_CONFIG" != xno; then 
     CodePatterns_CFLAGS=`$CodePatterns_CONFIG --cflags`
     CodePatterns_LIBS=`$CodePatterns_CONFIG --libs`
@@ -61,6 +81,6 @@
   fi
   if test x$cp_cv_codepatterns_libs_prefix != x ; then
-    if test -e "$cp_cv_codepatterns_libs_prefix/lib/libCodePatterns.so"; then
-      CodePatterns_LIBS="-L$cp_cv_codepatterns_libs_prefix/lib -lCodePatterns"
+    if test -e "$cp_cv_codepatterns_libs_prefix/lib/lib$codepatterns_libname.so"; then
+      CodePatterns_LIBS="-L$cp_cv_codepatterns_libs_prefix/lib -l$codepatterns_libname"
       AC_MSG_NOTICE([codepatterns libs found and used.])
     else
@@ -82,6 +102,6 @@
     codepatterns_version=no
     if test x$codepatterns = xyes; then
-      AC_MSG_CHECKING(for CodePatterns - version >= $codepatterns_version_min)
-      if test "x$CodePatterns_CONFIG" != "x"; then
+      AC_MSG_CHECKING(for $codepatterns_libname - version >= $codepatterns_version_min)
+      if test "x$CodePatterns_CONFIG" != xno; then
         codepatterns_version=`$CodePatterns_CONFIG --version`
       else
@@ -153,5 +173,5 @@
     LIBS="$CodePatterns_LIBS -lboost_thread"
     if test x$codepatterns_version = xyes; then
-      AC_CACHE_CHECK(for CodePatterns lib, cp_cv_codepatterns_lib, [
+      AC_CACHE_CHECK(for $codepatterns_libname lib, cp_cv_codepatterns_lib, [
         AC_LANG_PUSH([C++])
         AC_LINK_IFELSE(
@@ -199,10 +219,10 @@
 
     if test "x$cp_cv_codepatterns_lib" = xyes ; then
-       ifelse([$2], , :, [$2])     
+       ifelse([$3], , :, [$3])     
     else
        CodePatterns_CFLAGS=""
        CodePatterns_LDFLAGS=""
        CodePatterns_LIBS=""
-       ifelse([$3], , :, [$3])
+       ifelse([$4], , :, [$4])
     fi
   fi
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 70672e3033fd826be8f117a9bb9d43e660dda95e)
+++ src/Makefile.am	(revision cdf2e4b35fbdd7c3205205e770e338e51473ef11)
@@ -73,6 +73,10 @@
 
 ##-@CODEPATTERNS_API_VERSION@
-lib_LTLIBRARIES = libCodePatterns.la
+lib_LTLIBRARIES = libCodePatterns.la libCodePatterns-debug.la
 libCodePatterns_LIBS = $(BOOST_THREAD_LIB)
+libCodePatterns_debug_LIBS = $(BOOST_THREAD_LIB)
+
+libCodePatterns_la_CPPFLAGS = -DNDEBUG -DNO_MEMDEBUG
+libCodePatterns_debug_la_CPPFLAGS = -DMEMDEBUG -DLOG_OBSERVER
 
 ## Define the source file list for the "libexample-@CODEPATTERNS_API_VERSION@.la"
@@ -86,4 +90,5 @@
 #-$(CODEPATTERNS_API_VERSION)
 libCodePatterns_la_SOURCES = ${HELPERSSOURCE}
+libCodePatterns_debug_la_SOURCES = ${HELPERSSOURCE}
 
 ## Instruct libtool to include ABI version information in the generated shared
@@ -92,4 +97,5 @@
 #-$(CODEPATTERNS_API_VERSION)
 libCodePatterns_la_LDFLAGS = -version-info $(CODEPATTERNS_SO_VERSION)
+libCodePatterns_debug_la_LDFLAGS = -version-info $(CODEPATTERNS_SO_VERSION)
 
 ## The generated configuration header is installed in its own subdirectory of
@@ -113,5 +119,5 @@
 ## in which case the correct install location would be $(datadir)/pkgconfig.
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(top_builddir)/CodePatterns.pc
+pkgconfig_DATA = $(top_builddir)/CodePatterns.pc $(top_builddir)/CodePatterns-debug.pc
 
 FORCE:
Index: src/Patterns/unittests/Makefile.am
===================================================================
--- src/Patterns/unittests/Makefile.am	(revision 70672e3033fd826be8f117a9bb9d43e660dda95e)
+++ src/Patterns/unittests/Makefile.am	(revision cdf2e4b35fbdd7c3205205e770e338e51473ef11)
@@ -20,5 +20,5 @@
 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_THREAD_LIB)
 TESTLIBS = \
-	../../libCodePatterns.la \
+	../../libCodePatterns-debug.la \
 	$(BOOST_LIB)
 
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 70672e3033fd826be8f117a9bb9d43e660dda95e)
+++ src/unittests/Makefile.am	(revision cdf2e4b35fbdd7c3205205e770e338e51473ef11)
@@ -20,5 +20,5 @@
 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_THREAD_LIB)
 TESTLIBS = \
-	../libCodePatterns.la \
+	../libCodePatterns-debug.la \
 	$(BOOST_LIB)
 
