Blame m4/cxx-dynamic-initializers.m4

Packit Service a2489d
dnl check if c++ compiler can use dynamic initializers for static variables
Packit Service a2489d
AC_DEFUN([CXX_DYNAMIC_INITIALIZERS],
Packit Service a2489d
[
Packit Service a2489d
   AC_LANG_PUSH(C++)
Packit Service a2489d
   AC_MSG_CHECKING(if c++ compiler can handle dynamic initializers)
Packit Service a2489d
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
Packit Service a2489d
      int f() { return 1; }
Packit Service a2489d
      int a=f();
Packit Service a2489d
      int main()
Packit Service a2489d
      {
Packit Service a2489d
	 return(1-a);
Packit Service a2489d
      }
Packit Service a2489d
   ]])],[cxx_dynamic_init=yes],[cxx_dynamic_init=no],[cxx_dynamic_init=yes])
Packit Service a2489d
   AC_MSG_RESULT($cxx_dynamic_init)
Packit Service a2489d
   if test x$cxx_dynamic_init = xno; then
Packit Service a2489d
      AC_MSG_ERROR(C++ compiler cannot handle dynamic initializers of static objects)
Packit Service a2489d
   fi
Packit Service a2489d
   AC_LANG_POP(C++)
Packit Service a2489d
])