X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=config%2Flyxinclude.m4;h=4fb2a8d44ea0d4107d99dedfe692c45d1313acc5;hb=69eb262721b4454fe7af683adca502451098f7fb;hp=46b56171e41e56ce27695f87ebef36f0863b9a92;hpb=f3ec89cfa15feae8aa3185413eda55f28cc6551e;p=features.git diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 46b56171e4..4fb2a8d44e 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -270,8 +270,8 @@ AC_REQUIRE([AC_PROG_CXXCPP]) ### We might want to force the C++ standard. AC_ARG_ENABLE(cxx-mode, - AS_HELP_STRING([--enable-cxx-mode],[choose C++ standard (default: 14, then 11)]),, - [enable_cxx_mode={14,11}] + AS_HELP_STRING([--enable-cxx-mode],[choose C++ standard (default: 17, 14, then 11)]),, + [enable_cxx_mode={17,14,11}] ) AC_LANG_PUSH(C++) @@ -386,7 +386,7 @@ if test x$GXX = xyes; then AC_LANG_POP(C++) fi case $gxx_version in - 2.*|3.*|4.@<:@0-6@:>@) AC_MSG_ERROR([gcc >= 4.7 is required]);; + 2.*|3.*|4.@<:@0-8@:>@*) AC_MSG_ERROR([gcc >= 4.9 is required]);; esac if test x$enable_stdlib_debug = xyes ; then dnl FIXME: for clang/libc++, one should define _LIBCPP_DEBUG2=0 @@ -416,68 +416,63 @@ if test x$GXX = xyes; then fi ]) +dnl Usage: LYX_USE_INCLUDED_NOD : select if the included nod should be used. +AC_DEFUN([LYX_USE_INCLUDED_NOD],[ + AC_MSG_CHECKING([whether to use included nod library]) + AC_ARG_WITH(included-nod, + [AS_HELP_STRING([--without-included-nod], [do not use the nod lib supplied with LyX, try to find one in the system directories - compilation will abort if nothing suitable is found])], + [lyx_cv_with_included_nod=$withval], + [lyx_cv_with_included_nod=yes]) + AM_CONDITIONAL(USE_INCLUDED_NOD, test x$lyx_cv_with_included_nod = xyes) + AC_MSG_RESULT([$lyx_cv_with_included_nod]) + if test x$lyx_cv_with_included_nod = xyes ; then + lyx_included_libs="$lyx_included_libs nod" + NOD_INCLUDES='-I$(top_srcdir)/3rdparty/nod' + else + NOD_INCLUDES= + AC_LANG_PUSH(C++) + AC_MSG_CHECKING([for nod library]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], + [nod::scoped_connection conn;])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find suitable nod library (do not use --without-included-nod)]) + ]) + AC_LANG_POP(C++) + fi + AC_SUBST(NOD_INCLUDES) +]) + dnl Usage: LYX_USE_INCLUDED_BOOST : select if the included boost should dnl be used. AC_DEFUN([LYX_USE_INCLUDED_BOOST],[ AC_MSG_CHECKING([whether to use included boost library]) AC_ARG_WITH(included-boost, - [AS_HELP_STRING([--without-included-boost], [do not use the boost lib supplied with LyX, try to find one in the system directories - compilation will abort if nothing suitable is found])], + [AS_HELP_STRING([--with-included-boost], [use the boost lib supplied with LyX])], [lyx_cv_with_included_boost=$withval], - [lyx_cv_with_included_boost=yes]) + [lyx_cv_with_included_boost=no]) AM_CONDITIONAL(USE_INCLUDED_BOOST, test x$lyx_cv_with_included_boost = xyes) AC_MSG_RESULT([$lyx_cv_with_included_boost]) + if test x$lyx_cv_with_included_boost = xno ; then + AC_LANG_PUSH(C++) + AC_MSG_CHECKING([for boost library]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], + [boost::crc_32_type crc;])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + lyx_cv_with_included_boost=yes + ]) + AC_LANG_POP(C++) + fi if test x$lyx_cv_with_included_boost = xyes ; then lyx_included_libs="$lyx_included_libs boost" BOOST_INCLUDES='-I$(top_srcdir)/3rdparty/boost' - if test $lyx_std_regex = yes ; then - BOOST_LIBS="" - else - BOOST_LIBS='$(top_builddir)/3rdparty/boost/liblyxboost.a' - fi else BOOST_INCLUDES= - if test $lyx_std_regex = yes ; then - BOOST_LIBS="" - else - AC_LANG_PUSH(C++) - save_LIBS=$LIBS - - AC_MSG_CHECKING([for multithreaded boost libraries]) - LIBS="$save_LIBS -lboost_regex-mt $LIBTHREAD" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], - [boost::regex reg;])], - [AC_MSG_RESULT([yes]) - BOOST_MT="-mt"], - [AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for plain boost libraries]) - LIBS="$save_LIBS -lboost_regex" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], - [boost::regex reg;])], - [AC_MSG_RESULT([yes]) - BOOST_MT=""], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([cannot find suitable boost library (do not use --without-included-boost)]) - ]) - ]) - LIBS=$save_LIBS - AC_LANG_POP(C++) - - dnl In general, system boost libraries are incompatible with - dnl the use of stdlib-debug in libstdc++. See ticket #9736 for - dnl details. - if test $enable_stdlib_debug = "yes" ; then - LYX_WARNING([Compiling LyX with stdlib-debug and system boost libraries may lead to - crashes. Consider using --disable-stdlib-debug or removing - --without-included-boost.]) - fi - - BOOST_LIBS="-lboost_regex${BOOST_MT}" - fi fi AC_SUBST(BOOST_INCLUDES) - AC_SUBST(BOOST_LIBS) ])