r160: *** empty log message ***
[ctsim.git] / configure.in
index 76052e754fc28eafde443a38c62b29a99f5e484f..e2c9244c1aea20bbdade8c092f6b11934b663ac1 100644 (file)
@@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout
 dnl CDPATH=
 
 AC_INIT(src/ctsim.cpp)
-AM_INIT_AUTOMAKE(ctsim,2.0.0-b6)
+AM_INIT_AUTOMAKE(ctsim,2.0.0-b7)
 AM_CONFIG_HEADER(config.h)
 
 dnl Checks for programs.
@@ -80,7 +80,6 @@ AC_CHECK_LIB(g2, main, [g2=true], [g2=false])
 wxwin=false
 AC_CHECK_LIB(wx_gtk, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS)])
 AC_CHECK_LIB(wx_msw, main, [wxwin=true; wx_msw=true; AC_DEFINE(HAVE_WXWINDOWS)])
-AC_CHECK_LIB(dmallocxx, main, [dmalloc=true], [dmalloc=false])
 AC_CHECK_LIB(hdf5, main, [hdf5=true], [hdf5=false], -lz)
 AC_CHECK_LIB(fftw, main, [fftw=true; AC_DEFINE(HAVE_FFTW)], [fftw=false])
 
@@ -318,6 +317,29 @@ if test "$fftw" = "true" ; then
   ctlibs_tools="$ctlibs_tools -lrfftw -lfftw"
 fi
 
+dnl Check for dmalloc
+AC_CHECK_LIB(dmallocxx, main, [dmallocxx=true], [dmallocxx=false])
+AC_MSG_CHECKING([for enable-dmalloc])
+AC_ARG_ENABLE(dmalloc,
+[  --enable-dmalloc        Use dmalloc memory allocation],
+[case "${enableval}" in
+  yes) usedmalloc=true 
+       AC_MSG_RESULT(yes)
+       ;;
+  no)  usedmalloc=false 
+       AC_MSG_RESULT(no)
+       ;;
+  *) AC_MSG_RESULT([bad value ${enableval} for --enable-dmalloc]) 
+       ;;
+esac],
+[usedmalloc=false; AC_MSG_RESULT(no)])
+
+if test "$dmallocxx" = "true" -a "$usedmalloc" = "true" ; then
+  ctlibs_tools="$ctlibs_tools -ldmallocxx"
+  AC_DEFINE(HAVE_DMALLOC)
+  AC_MSG_RESULT(Using dmalloc)
+fi
+
 dnl Setting projet libraries and includes
 LDFLAGS="$LDFLAGS -L../libctsupport -L../libctsim" 
 ctlibs="$ctlibs_base -lctsim $ctlibs_graphics -lctsupport $ctlibs_tools"