]> git.lyx.org Git - lyx.git/commitdiff
Use subdir-objects for automake 1.14 or newer
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 20 Apr 2014 18:20:25 +0000 (20:20 +0200)
committerRichard Heck <rgheck@lyx.org>
Mon, 21 Apr 2014 15:52:00 +0000 (11:52 -0400)
This option is going to be mandatory starting with automake 2.0.
LyX is able to use this since version 2.1, but it turns out that it is
badly implemented in versions of automake older than 1.14.

We rely on some (undocumented) symbol to detect automake 1.14 and
use the subdirs-objects option in this case.

For more details, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181023.html

Making everything work with autotools required making a copy of two
files from support/tests. It seems that we should not point to source files
that are handled by another Makefile.am.

configure.ac
src/Makefile.am
src/tests/CMakeLists.txt
src/tests/boost.cpp [new file with mode: 0644]
src/tests/dummy_functions.cpp [new file with mode: 0644]

index 1ce2ed3a24852dd1df82cab1f02f4796fc57309a..e3302e45f04e779ef75a786c509fba8353cc5858 100644 (file)
@@ -27,7 +27,11 @@ fi
 AM_MAINTAINER_MODE
 
 save_PACKAGE=$PACKAGE
-AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.8])
+dnl The test for _AM_PROG_CC_C_O intends to test for automake 1.14 or newer,
+dnl which are the versions where subdir-objects can beused.
+dnl see: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181023.html
+m4_define([LYX_OBJECTS_LAYOUT], m4_ifdef([_AM_PROG_CC_C_O],[subdir-objects],))
+AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.8] LYX_OBJECTS_LAYOUT)
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 PACKAGE=$save_PACKAGE
 
index ea5ca423406d6cb08a036ea221f34ec6577edbce..2a986437f1bc1dcbd2ca4aca2361bda231528982 100644 (file)
@@ -708,7 +708,7 @@ check_layout_SOURCES = \
        Spacing.cpp \
        TextClass.cpp \
        tests/check_layout.cpp \
-       support/tests/boost.cpp \
-       support/tests/dummy_functions.cpp
+       tests/boost.cpp \
+       tests/dummy_functions.cpp
 
 .PHONY: alltests alltests-recursive updatetests
index 2a8b39e44f9d59b0c07424748b75f76e21188197..ce5b3556ca47d0d123f17f186b171133e3b7f7fd 100644 (file)
@@ -8,7 +8,7 @@ set(check_layout_SOURCES)
 foreach(_f insets/InsetLayout.cpp Color.cpp Counters.cpp Floating.cpp
        FloatList.cpp FontInfo.cpp Layout.cpp LayoutFile.cpp Lexer.cpp
        ModuleList.cpp Spacing.cpp TextClass.cpp tests/check_layout.cpp
-       support/tests/boost.cpp support/tests/dummy_functions.cpp)
+       tests/boost.cpp tests/dummy_functions.cpp)
   list(APPEND check_layout_SOURCES "${TOP_SRC_DIR}/src/${_f}")
 endforeach()
 
diff --git a/src/tests/boost.cpp b/src/tests/boost.cpp
new file mode 100644 (file)
index 0000000..426263b
--- /dev/null
@@ -0,0 +1,36 @@
+/**
+ * \file boost.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "support/lassert.h"
+
+#include <cstdlib>
+#include <exception>
+
+using namespace std;
+
+namespace boost {
+
+#ifndef BOOST_NO_EXCEPTIONS
+void throw_exception(exception const & /*e*/)
+{
+       LASSERT(false, /**/);
+}
+#endif
+
+
+void assertion_failed(char const * /*expr*/, char const * /*function*/,
+                     char const * /*file*/, long /*line*/)
+{
+       ::abort();
+}
+
+} // namespace boost
diff --git a/src/tests/dummy_functions.cpp b/src/tests/dummy_functions.cpp
new file mode 100644 (file)
index 0000000..5a99081
--- /dev/null
@@ -0,0 +1,38 @@
+#include <config.h>
+
+#include "../Messages.h"
+
+using namespace std;
+
+namespace lyx {
+       // Dummy LyXRC support
+       class LyXRC { string icon_set; } lyxrc;
+
+       // Dummy LyXAlignment support
+       enum LyXAlignment {
+               DUMMY
+       };
+
+       // Keep the linker happy on Windows
+       void lyx_exit(int) {}
+
+       // Dummy language support
+       Messages const & getGuiMessages()
+       {
+               static Messages lyx_messages;
+
+               return lyx_messages;
+       }
+       Messages const & getMessages(string const &)
+       {
+               static Messages lyx_messages;
+
+               return lyx_messages;
+       }
+
+       string alignmentToCSS(LyXAlignment)
+       {
+               return string();
+       }
+
+}