-fi])dnl
-
-
-dnl NOT USED CURRENTLY*************************************
-dnl Usage: LYX_CXX_RTTI : checks whether the C++ compiler
-dnl supports RTTI
-AC_DEFUN(LYX_CXX_RTTI,[
-### Check whether the compiler supports runtime type information
-AC_CACHE_CHECK(whether the C++ compiler supports RTTI,lyx_cv_rtti,
- [AC_TRY_RUN([
-class rtti {
-public:
- virtual int tag() { return 0; }
-};
-class derived1 : public rtti {
-public:
- int tag() { return 1; }
-};
-class derived2 : public rtti {
-public:
- int tag() { return 2; }
-};
-int main() {
- derived1 * foo1 = new derived1();
- derived2 * foo2 = new derived2();
- rtti * bar = foo1;
- derived1 * bar1 = dynamic_cast<derived1 *>(bar);
- if (bar1 == 0)
- exit(1);
- bar = foo2;
- bar1 = dynamic_cast<derived1 *>(bar);
- if (bar1 != 0)
- exit(1);
- return 0;
-}
-],lyx_cv_rtti=yes,lyx_cv_rtti=no,lyx_cv_rtti=no)
-])
-if test x$lyx_cv_rtti = xyes ; then
- AC_DEFINE(HAVE_RTTI, 1,
- [Define to 1 if your compiler supports runtime type information])
-fi])
-
-
-dnl Usage: LYX_CXX_EXPLICIT : checks whether the C++ compiler
-dnl understands the "explicit" directive.
-AC_DEFUN(LYX_CXX_EXPLICIT,[
-### Check whether the compiler understands the keyword `explicit'
-AC_CACHE_CHECK(whether the C++ compiler understands explicit,lyx_cv_explicit,
- [AC_TRY_COMPILE([
-class Expl {
-public:
- explicit Expl() {}
-};],,lyx_cv_explicit=yes,lyx_cv_explicit=no)
-])
-if test $lyx_cv_explicit = no ; then
- AC_DEFINE(explicit,[ ],
- [Define to nothing if your compiler does not understand the
- 'explicit' directive])
-fi])
-
-
-dnl NOT USED CURRENTLY*************************************
-dnl Usage: LYX_CXX_STL_STACK : checks whether the C++ compiler
-dnl has a working stl stack template
-AC_DEFUN(LYX_CXX_STL_STACK,[
-AC_CACHE_CHECK(for broken STL stack template,lyx_cv_broken_stack,
- [AC_TRY_COMPILE([
-#include <stack>
-using std::stack;
-],[
- stack<int> stakk;
- stakk.push(0);
-],lyx_cv_broken_stack=no,lyx_cv_broken_stack=yes)
-])
-if test $lyx_cv_broken_stack = yes ; then
- AC_DEFINE(BROKEN_STL_STACK, 1,
- [Define if you have the STL from libg++ 2.7.x, where stack<> is not defined
- correctly])
-fi])
-
-
-dnl Usage: LYX_STD_COUNT : checks wherer the C++ library have a conforming
-dnl count template, if not the old HP version is assumed.
-AC_DEFUN(LYX_STD_COUNT,[
-AC_CACHE_CHECK(for conforming std::count,lyx_cv_std_count,
- [AC_TRY_COMPILE([
-#include <algorithm>
-using std::count;
-int countChar(char * b, char * e, char const c)
-{
- return count(b, e, c);
-}
-],[
- char a[] = "hello";
- int i = countChar(a, a + 5, 'l');
-],lyx_cv_std_count=yes,lyx_cv_std_count=no)
-])
-if test $lyx_cv_std_count = yes ; then
- AC_DEFINE(HAVE_STD_COUNT, 1,
- [Define if you have a conforming std::count template, otherwise HP version of count template is assumed.])
-fi])
-
-
-dnl Usage: LYX_CXX_STL_MODERN_STREAMS : checks whether the C++ compiler
-dnl supports modern STL streams
-AC_DEFUN(LYX_CXX_STL_MODERN_STREAMS,[
-AC_CACHE_CHECK(for modern STL streams,lyx_cv_modern_streams,
- [AC_TRY_COMPILE([
-#include <iostream>
-],[
- std::streambuf * test = std::cerr.rdbuf();
- test->pubsync();
-],lyx_cv_modern_streams=yes,lyx_cv_modern_streams=no)
-])
-if test $lyx_cv_modern_streams = yes ; then
- AC_DEFINE(MODERN_STL_STREAMS, 1,
- [Define if you have modern standard-compliant STL streams])
-fi])
-
-
-dnl Usage: LYX_CXX_STL_STRING : checks whether the C++ compiler
-dnl has a std::string that is usable for LyX. LyX does not require this
-dnl std::string to be standard.
-AC_DEFUN(LYX_CXX_STL_STRING,[
- AC_REQUIRE([AC_PROG_CXX])
- AC_MSG_CHECKING(whether the included std::string should be used)
- AC_ARG_WITH(included-string,
- [ --with-included-string use LyX string class instead of STL string],
- [lyx_cv_with_included_string=$withval
- AC_MSG_RESULT([$with_included_string])],
- [AC_CACHE_CHECK([],lyx_cv_with_included_string,
- [AC_TRY_COMPILE([
- #include <string>
- using std::string;
- ],[
- // LyX has reduced its requirements on the basic_string
- // implementation so that the basic_string supplied
- // with gcc is usable. In particular this means that
- // lyx does not use std::string::clear and not the
- // strncmp version of std::string::compare. This is mainly
- // done so that LyX can use precompiled C++ libraries that
- // already uses the systems basic_string, e.g. gtk--
- string a("hello there");
- a.erase();
- a = "hey";
- //char s[] = "y";
- //int t = a.compare(a.length() - 1, 1, s);
- a.erase();
- ],[
- lyx_cv_with_included_string=no
- ],[
- lyx_cv_with_included_string=yes
- ])
- ])
- ])
- if test x$lyx_cv_with_included_string = xyes ; then
- AC_DEFINE(USE_INCLUDED_STRING, 1,
- [Define to use the lyxstring class bundled with LyX.])
- lyx_flags="$lyx_flags included-string"
- fi
- AM_CONDITIONAL(USE_LYXSTRING, test x$lyx_cv_with_included_string = xyes)
-dnl AC_MSG_RESULT([$with_included_string])
-])
-