]> git.lyx.org Git - lyx.git/blobdiff - config/lyxinclude.m4
Make module categories (almost) great again
[lyx.git] / config / lyxinclude.m4
index ab5924de1aa7244fc08dc1b6e9d07c2e0d9eda81..8e1d2793cea063412af6811a757a62c3f178d974 100644 (file)
@@ -33,7 +33,6 @@ AC_MSG_RESULT([$build_type])
 lyx_flags="$lyx_flags build=$build_type"
 case $build_type in
     development) lyx_devel_version=yes
-                 AC_DEFINE(DEVEL_VERSION, 1, [Define if you are building a development version of LyX])
                 LYX_DATE="not released yet" ;;
     prerelease) lyx_prerelease=yes ;;
 esac
@@ -64,14 +63,18 @@ AC_MSG_RESULT([$withval])
 ])
 
 
-dnl Check whether to configure for Qt5. Default is Qt4.
+dnl Check whether to configure for Qt4 or Qt5. Default is Qt5.
 dnl
 AC_DEFUN([LYX_CHECK_QT5],[
-AC_MSG_CHECKING([whether Qt5 is requested])
+AC_MSG_CHECKING([whether Qt5 is disabled])
 AC_ARG_ENABLE([qt5],
-  [  --enable-qt5            use Qt5 for building],
-  USE_QT5=$enableval, USE_QT5=no)
-AC_MSG_RESULT([$USE_QT5])
+  [AC_HELP_STRING([--disable-qt5],[do not use Qt5 for building])],
+  USE_QT5=$enableval, USE_QT5=yes)
+if test x$USE_QT5 != xno ; then
+  AC_MSG_RESULT([no])
+else
+  AC_MSG_RESULT([yes])
+fi
 AC_SUBST([USE_QT5])
 ])
 
@@ -421,6 +424,7 @@ if test x$GXX = xyes; then
         lyx_flags="$lyx_flags stdlib-debug"
        AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode])
        AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode])
+       AC_SUBST(STDLIB_DEBUG, "-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
         ;;
     esac
   fi
@@ -605,22 +609,29 @@ dnl prevent clash with system zlib that might be dragged in by other libs
 dnl Usage: LYX_CHECK_CALLSTACK_PRINTING: define LYX_CALLSTACK_PRINTING if the
 dnl        necessary APIs are available to print callstacks.
 AC_DEFUN([LYX_CHECK_CALLSTACK_PRINTING],
-[AC_CACHE_CHECK([whether printing callstack is possible],
-               [lyx_cv_callstack_printing],
-[AC_TRY_COMPILE([
-#include <execinfo.h>
-#include <cxxabi.h>
-], [
-       void* array[200];
-       size_t size = backtrace(array, 200);
-       backtrace_symbols(array, size);
-       int status = 0;
-       abi::__cxa_demangle("abcd", 0, 0, &status);
-],
-[lyx_cv_callstack_printing=yes], [lyx_cv_callstack_printing=no])])
+[AC_ARG_ENABLE([callstack-printing],
+               [AC_HELP_STRING([--disable-callstack-printing],[do not print a callstack when crashing])],
+               lyx_cv_callstack_printing=$enableval, lyx_cv_callstack_printing=yes)
+
+if test x"$lyx_cv_callstack_printing" = xyes; then
+  AC_CACHE_CHECK([whether printing callstack is possible],
+                [lyx_cv_callstack_printing],
+  [AC_TRY_COMPILE([
+  #include <execinfo.h>
+  #include <cxxabi.h>
+  ], [
+         void* array[200];
+         size_t size = backtrace(array, 200);
+         backtrace_symbols(array, size);
+         int status = 0;
+         abi::__cxa_demangle("abcd", 0, 0, &status);
+  ],, [lyx_cv_callstack_printing=no])])
+fi
 if test x"$lyx_cv_callstack_printing" = xyes; then
   AC_DEFINE([LYX_CALLSTACK_PRINTING], 1,
             [Define if callstack can be printed])
+  lyx_flags="$lyx_flags callback-printing"
+  AM_LDFLAGS="${AM_LDFLAGS} -rdynamic"
 fi
 ])
 
@@ -937,23 +948,3 @@ AC_DEFUN([LYX_SET_VERSION_INFO],
  AC_SUBST(LYX_USERDIR_VER,"$lyx_userdir_ver")
 ])
 
-# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-# ---------------------------------------------------------------------------
-# Copied from autoconf 2.68, added a check that python version is < 3.0
-# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
-# Run ACTION-IF-FALSE otherwise.
-# This test uses sys.hexversion instead of the string equivalent (first
-# word of sys.version), in order to cope with versions such as 2.2c1.
-# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
-AC_DEFUN([AM_PYTHON_CHECK_VERSION],
- [prog="import sys
-# split strings by '.' and convert to numeric.  Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
-minverhex = 0
-maxverhex = 50331648 # = 3.0.0.0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
-sys.exit(sys.hexversion < minverhex or sys.hexversion >= maxverhex)"
-  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])