-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])
-])
-
-
-dnl Usage: LYX_CXX_GOOD_STD_STRING : checks whether the C++ compiler
-dnl has a std::string that is close to the standard. So close that
-dnl methods not found in "unstandard" std::strings are present here.
-AC_DEFUN(LYX_CXX_GOOD_STD_STRING,[
- AC_REQUIRE([AC_PROG_CXX])
- AC_CACHE_CHECK([whether the systems std::string is really good],
- [lyx_cv_std_string_good],
- [AC_TRY_COMPILE([
- #include <string>
- using std::string;
- ],[
- // From a std::string that is supposed to be close to the
- // standard we require at least three things:
- // - clear() and erase()
- // - the strncmp of compare()
- // - push_back()
- string a("hello there");
- a.erase();
- a = "hey";
- char s[] = "y";
- int t = a.compare(a.length() - 1, 1, s);
- a.push_back('g');
- a.clear();
- ],[
- lyx_cv_std_string_good=yes
- ],[
- lyx_cv_std_string_good=no
-
- ])
- ])
- if test x$lyx_cv_std_string_good = xyes ; then
- AC_DEFINE(STD_STRING_IS_GOOD, 1,
- [Define if the systems std::string is really good.])
- fi
-])
-
-
-dnl NOT USED CURRENTLY*************************************
-dnl LYX_CXX_PARTIAL
-AC_DEFUN(LYX_CXX_PARTIAL, [
- AC_REQUIRE([AC_PROG_CXX])
- AC_CACHE_CHECK([if C++ compiler supports partial specialization],
- [lyx_cv_cxx_partial_specialization],
- [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;
- ],[
- lyx_cv_cxx_partial_specialization=yes
- ],[
- lyx_cv_cxx_partial_specialization=no
- ])
- ])
- if test x$lyx_cv_cxx_partial_specialization = xyes ; then
- AC_DEFINE(HAVE_PARTIAL_SPECIALIZATION, 1,
- [Defined if your compiler supports partial specialization.])
- fi
-])
-
-
-dnl Usage: LYX_CXX_CHEADERS : checks whether the C++ compiler
-dnl provides wrappers for C headers and use our alternate version otherwise.
-AC_DEFUN(LYX_CXX_CHEADERS,[
-AC_CACHE_CHECK(for C headers wrappers,lyx_cv_cxx_cheaders,
- [AC_TRY_CPP([
-#include <clocale>
-#include <cctype>
-#include <cerrno>
-#include <cmath>
-#include <csignal>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <ctime>],[lyx_cv_cxx_cheaders=yes],[lyx_cv_cxx_cheaders=no])])
-if test $lyx_cv_cxx_cheaders = no ; then
- LYX_ADD_INC_DIR(lyx_cppflags,\$(top_srcdir)/src/cheaders)
-fi])
-
-dnl Usage: LYX_CXX_GLOBAL_CSTD: checks whether C library functions
-dnl are already in the global namespace
-AC_DEFUN(LYX_CXX_GLOBAL_CSTD,[
- AC_CACHE_CHECK(whether C library functions are already in the global namespace,
- lyx_cv_cxx_global_cstd,
- [AC_TRY_COMPILE([
- #include <cctype>
- using std::tolower;
- ],[
- return 0;
- ],[lyx_cv_cxx_global_cstd=no],[lyx_cv_cxx_global_cstd=yes])])
- if test x$lyx_cv_cxx_global_cstd = xyes; then
- AC_DEFINE(CXX_GLOBAL_CSTD,1,
- [Define if your C++ compiler puts C library functions in the global namespace])
- fi
-])
-
-dnl Usage LYX_PATH_XPM: Checks for xpm library and header
-AC_DEFUN(LYX_PATH_XPM,[
-### Check for Xpm library
-AC_CHECK_LIB(Xpm, XpmCreateBufferFromImage, XPM_LIB="-lXpm",
- [LYX_LIB_ERROR(libXpm,Xpm)])
-AC_SUBST(XPM_LIB)
-### Check for Xpm headers
-lyx_cv_xpm_h_location="<xpm.h>"
-AC_CHECK_HEADER(X11/xpm.h,[
- ac_cv_header_xpm_h=yes
- lyx_cv_xpm_h_location="<X11/xpm.h>"],[
-AC_CHECK_HEADER(xpm.h,[],[
-LYX_LIB_ERROR(xpm.h,Xpm)])])
-AC_DEFINE_UNQUOTED(XPM_H_LOCATION,$lyx_cv_xpm_h_location,
- [define this to the location of xpm.h to be used with #include, e.g. <xpm.h>])
-
-### Test for the header version
-if test $ac_cv_header_xpm_h = yes; then
- AC_CACHE_CHECK([xpm header version],lyx_cv_xpmversion,
- [ cat > conftest.$ac_ext <<EOF
-#line __oline__ "configure"
-#include "confdefs.h"
-
-#include XPM_H_LOCATION
-"%%%"lyx_cv_xpmv=XpmVersion;lyx_cv_xpmr=XpmRevision"%%%"
-EOF
- eval `(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
- grep '^"%%%"' 2>/dev/null | \
- sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'`
- case "$lyx_cv_xpmr" in
-changequote(,)
- [0-9]) lyxxpmr_alpha=`echo $lyx_cv_xpmr |tr 123456789 abcdefghi`
- lyxxpmv_alpha=" (aka 3.$lyx_cv_xpmv$lyxxpmr_alpha)";;
-changequote([,])
- *) ;;