summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/configure.ac
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-02-27 03:26:59 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-02-27 03:26:59 +0000
commit6f1d9dd9f40b000f03c209207e98d8a4469594bb (patch)
tree7f822db4fc92fa66f9ea97a862242b8124f9965b /sca-cpp/trunk/configure.ac
parent352462dacc05290102a18fa77964998d68e6380d (diff)
Add options to use mmap or electric fence to check memory accesses, and fix a few memory access violations.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1294008 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/configure.ac')
-rw-r--r--sca-cpp/trunk/configure.ac42
1 files changed, 41 insertions, 1 deletions
diff --git a/sca-cpp/trunk/configure.ac b/sca-cpp/trunk/configure.ac
index cb85c3930e..6adf807db2 100644
--- a/sca-cpp/trunk/configure.ac
+++ b/sca-cpp/trunk/configure.ac
@@ -123,7 +123,6 @@ if test "${want_maintainer_mode}" = "true"; then
else
cxxflags="${cxxflags} -O2 -Wlogical-op -Wconversion"
fi
- ldflags="${ldflags} -pg"
AM_CONDITIONAL([WANT_MAINTAINER_MODE], true)
AC_DEFINE([WANT_MAINTAINER_MODE], 1, [compile with debugging and compile-time warnings])
else
@@ -158,6 +157,47 @@ else
AM_CONDITIONAL([WANT_PROFILING], false)
fi
+# Enable memory checking with electric fence.
+AC_MSG_CHECKING([whether to enable electric fence])
+AC_ARG_ENABLE(efence, [AS_HELP_STRING([--enable-efence], [link with electric fence [default=no]])],
+[ case "${enableval}" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ want_efence=true
+ ;;
+ esac ],
+[ AC_MSG_RESULT(no)])
+if test "${want_efence}" = "true"; then
+ ldflags="${ldflags} -lefence"
+ AM_CONDITIONAL([WANT_EFENCE], true)
+ AC_DEFINE([WANT_EFENCE], 1, [link with electric fence])
+else
+ AM_CONDITIONAL([WANT_EFENCE], false)
+fi
+
+# Enable usage of mmap for memory allocation.
+AC_MSG_CHECKING([whether to use mmap for memory allocation])
+AC_ARG_ENABLE(malloc-mmap, [AS_HELP_STRING([--enable-malloc-mmap], [use mmap for memory allocation [default=no]])],
+[ case "${enableval}" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ want_malloc_mmap=true
+ ;;
+ esac ],
+[ AC_MSG_RESULT(no)])
+if test "${want_efence}" = "true"; then
+ AM_CONDITIONAL([WANT_MALLOC_MMAP], true)
+ AC_DEFINE([WANT_MALLOC_MMAP], 1, [use mmap for memory allocation])
+else
+ AM_CONDITIONAL([WANT_MALLOC_MMAP], false)
+fi
+
# Enable multi-threading support.
AC_MSG_CHECKING([whether to compile for multi-threaded execution])
AC_ARG_ENABLE(threads, [AS_HELP_STRING([--enable-threads], [compile for multi-threaded execution [default=no]])],