AC_MSG_CHECKING(if C++ compiler supports bool (required))
AC_TRY_COMPILE(
[
],[
bool b=true;
bool b1=false;
],[
ac_bool=yes
AC_MSG_RESULT([$ac_bool])
],[
config_error=yes
AC_MSG_RESULT([$ac_bool])
AC_WARN(bool type is not supported by your compiler)
])
AC_MSG_CHECKING([if C++ compiler supports const_cast<> (required)])
AC_TRY_COMPILE(
[
class foo;
],[
const foo *c=0;
foo *c1=const_cast<foo*>(c);
],[
ac_const_cast=yes
AC_MSG_RESULT([$ac_const_cast])
],[
AC_MSG_RESULT([$ac_const_cast])
AC_WARN(C++ compiler const_cast<> does not work)
config_error=yes
])
# Member function templates
AC_MSG_CHECKING(if C++ compiler supports member function templates)
AC_TRY_COMPILE(
[
class foo
{
public:
template <class T> void method(T t);
};
template <class T> void foo::method(T t) {t = 0;}
],[
],[
ac_member_func_templates=yes
AC_DEFINE(SIGC_CXX_MEMBER_FUNC_TEMPLATES)
AC_MSG_RESULT([$ac_member_func_templates])
],[
ac_member_func_templates=no
AC_MSG_RESULT([$ac_member_func_templates])
config_error=yes
AC_MSG_WARN([Test for member templates failed. This disables some methods that requires member template support. If your compiler should support member templates, see config.log to figure out why the test failed.])
])
# Member class templates
AC_MSG_CHECKING(if C++ compiler supports member class templates)
AC_TRY_COMPILE(
[
struct S
{
template <class T> struct A {};
template <class T> struct B {};
};
],[
],[
ac_member_class_templates=yes
AC_DEFINE(SIGC_CXX_MEMBER_CLASS_TEMPLATES)
AC_MSG_RESULT([$ac_member_class_templates])
],[
ac_member_class_templates=no
AC_MSG_RESULT([$ac_member_class_templates])
AC_MSG_WARN([Test for member templates failed. This disables some methods that requires member template support. If your compiler should support member templates, see config.log to figure out why the test failed.])
])
# Mutable
AC_MSG_CHECKING(if C++ compiler supports mutable)
AC_TRY_COMPILE(
[
class k {
mutable char *c;
public:
void foo() const { c=0; }
};
],[
],[
ac_cxx_mutable=yes
AC_DEFINE(SIGC_CXX_MUTABLE)
],[
ac_cxx_mutable=no
])
AC_MSG_RESULT([$ac_cxx_mutable])
# Partial Specialization
AC_MSG_CHECKING([if C++ compiler supports partial specialization(required)])
AC_TRY_COMPILE(
[
template<class T, class K>
class k {
public:
};
template<class T> class k<void,T> { };
],[
k<float, float> b;
k<void,void> a;
],[
ac_cxx_partial_specialization=yes
AC_MSG_RESULT([$ac_cxx_partial_specialization])
AC_DEFINE(SIGC_CXX_PARTIAL_SPEC)
],[
config_error=yes
ac_cxx_partial_specialization=no
AC_MSG_RESULT([$ac_cxx_partial_specialization])
AC_MSG_WARN([Partial specialization is needed for signal templates.])
])
AC_MSG_CHECKING(if C++ compiler supports name spaces)
AC_TRY_COMPILE(
[
namespace Check
{
int i;
}
],[
Check::i=1;
],[
ac_cxx_namespaces=yes
AC_MSG_RESULT([$ac_cxx_namespaces])
AC_DEFINE(SIGC_CXX_NAMESPACES)
],[
ac_cxx_namespaces=no
AC_MSG_RESULT([$ac_cxx_namespaces])
AC_MSG_WARN([Without namespaces all classes will be global.])
])
AC_MSG_CHECKING(if C++ compiler supports friend template)
AC_TRY_COMPILE(
[
struct A
{
template <class T>
friend T* gen();
};
],[
],[
ac_cxx_friend_templates=yes
AC_MSG_RESULT([$ac_cxx_friend_templates])
AC_DEFINE(SIGC_CXX_FRIEND_TEMPLATES)
],[
ac_cxx_friend_templates=no
AC_MSG_RESULT([$ac_cxx_friend_templates])
AC_MSG_WARN([Access to dynamic will not be controlled.])
])
AC_MSG_CHECKING(if C++ compiler has intrinsic constructors)
AC_TRY_COMPILE(
[
template<class T>
struct A
{ T t;
A(): t() {}
};
A<int> i;
],[
],[
AC_DEFINE(SIGC_CXX_INT_CTOR)
ac_cxx_tmpl_intctor=yes
],[
ac_cxx_tmpl_intctor=no
])
AC_MSG_RESULT([$ac_cxx_tmpl_intctor])
AC_MSG_CHECKING(if C++ compiler uses template copy ctor)
AC_TRY_COMPILE(
[
template <class T>
struct A
{
A(const A&) {}
template <class T1>
A(const T1&) {}
};
],[
],[
ac_cxx_template_cctor=no
],[
AC_DEFINE(SIGC_CXX_TEMPLATE_CCTOR)
ac_cxx_template_cctor=yes
])
AC_MSG_RESULT([$ac_cxx_template_cctor])
AC_MSG_CHECKING(if C++ compiler allows void returns)
AC_TRY_COMPILE(
[
void g(int *p)
{}
void h(int *p)
{return g(p);}
],[
],[
ac_cxx_void_return=yes
AC_DEFINE(SIGC_CXX_VOID_RETURN)
],[
ac_cxx_void_return=no
])
AC_MSG_RESULT([$ac_cxx_void_return])
AC_MSG_CHECKING(if C++ compiler allows specialization of references)
AC_TRY_COMPILE(
[
struct A {};
struct B {};
template <class T>
struct P
{
typedef A* ptr;
};
template <class T>
struct P<T&>
{
typedef B* ptr;
};
],[
A* a;
B* b;
P<int>::ptr p=a;
P<int&>::ptr q=b;
],[
ac_cxx_specialize_references=yes
AC_DEFINE(SIGC_CXX_SPECIALIZE_REFERENCES)
],[
ac_cxx_specialize_references=no
])
AC_MSG_RESULT([$ac_cxx_specialize_references])
dnl unused at the moment, disabled
dnl mirko, 99/1/15
dnl AC_MSG_CHECKING(if C++ compiler supports qualification of return types with templates)