diff --git a/configure.ac b/configure.ac index 929c24f28ef20c0ab645d79ea885c8e788cef7d0..bd29a1229ac2c191d3902f99e8822ba29fc9463e 100755 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,64 @@ else NVCCFLAGS+="$NVCCFLAGS -O3 " fi +###### Check for se-class1 + +AC_MSG_CHECKING(whether to build with security enhancement class1) +se_class1=no +AC_ARG_ENABLE(se-class1, + AC_HELP_STRING( + [--enable-se-class1], + [enable security enhancement class1] + ), + se_class1="$enableval" +) + + + +AC_MSG_RESULT($se_class1) +if test x"$se_class1" = x"yes"; then + AC_DEFINE([SE_CLASS1],[],[Security enhancement class 1]) +fi + + +###### Check for se-class 2 + +AC_MSG_CHECKING(whether to build with security enhancement class 2) +se_class2=no +AC_ARG_ENABLE(se-class2, + AC_HELP_STRING( + [--enable-se-class2], + [enable security enhancement class 2] + ), + se_class2="$enableval" +) + + +AC_MSG_RESULT($se_class2) +if test x"$se_class2" = x"yes"; then + AC_DEFINE([SE_CLASS2],[],[Security enhancement class 2]) +fi + +###### Check for se-class 3 + +AC_MSG_CHECKING(whether to build with security enhancement class 3) +se_class3=no +AC_ARG_ENABLE(se-class3, + AC_HELP_STRING( + [--enable-se-class3], + [enable security enhancement class 3] + ), + se_class3="$enableval" +) + + + +AC_MSG_RESULT($se_class3) +if test x"$se_class3" = x"yes"; then + AC_DEFINE([SE_CLASS3],[],[Security enhancement class 3]) +fi + + ##### CHECK FOR BOOST ############## AX_BOOST([1.52],[],[]) @@ -158,6 +216,21 @@ if [ test x"$debuger" = x"yes" ]; then else echo "* debug: no *" fi +if [ test x"$se_class1" = x"yes" ]; then + echo "* se-class1: yes *" +else + echo "* se-class1: no *" +fi +if [ test x"$se_class2" = x"yes" ]; then + echo "* se-class2: yes *" +else + echo "* se-class2: no *" +fi +if [ test x"$se_class3" = x"yes" ]; then + echo "* se-class3: yes *" +else + echo "* se-class3: no *" +fi if [ test x"$gpu_support" = x"no" ]; then echo "* gpu: no *" else diff --git a/src/Memleak_check.hpp b/src/Memleak_check.hpp index 24afa91cbcf9e9aedf8888849314b9ca17eab9f9..e96f3e3637d9d2ac7f53d49f031379a6efea8f78 100644 --- a/src/Memleak_check.hpp +++ b/src/Memleak_check.hpp @@ -38,7 +38,7 @@ static bool remove_ptr(const void * ptr) // if the element does not exist, print that something wrong happened and return if ( it == active_ptr.end() ) { - std::cout << "Error pointer not found " << ptr << "\n"; + std::cout << "Error " << __FILE__ << ":" << __LINE__ << " pointer not found " << ptr << "\n"; ACTION_ON_ERROR(MEM_ERROR); return false; } diff --git a/src/util/se_util.hpp b/src/util/se_util.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8d884e5f48aa846ea4df278873e56a7b398dac77 --- /dev/null +++ b/src/util/se_util.hpp @@ -0,0 +1,21 @@ +/* + * se_util.hpp + * + * Created on: Oct 22, 2015 + * Author: i-bird + */ + +#ifndef OPENFPM_DATA_SRC_UTIL_SE_UTIL_HPP_ +#define OPENFPM_DATA_SRC_UTIL_SE_UTIL_HPP_ + +// Macro that decide what to do in case of error +#ifdef STOP_ON_ERROR +#define ACTION_ON_ERROR(error) exit(1); +#elif defined(THROW_ON_ERROR) +#define ACTION_ON_ERROR(error) if (!std::uncaught_exception()) throw error; +#else +#define ACTION_ON_ERROR(error) +#endif + + +#endif /* OPENFPM_DATA_SRC_UTIL_SE_UTIL_HPP_ */