On Sun, Dec 13, 2020 at 04:23:56PM +0200, Yuriy Skalko wrote:
> 
> So, is this patch ready to be committed into master to have wider testing
> audience?

Please, note that your patch is incomplete for autotools. Attached you
can find a complementary patch that allows configuration and compilation
with autotools.

The hunks for 3rdparty/Makefile.am and 3rdparty/nod/Makefile.am should
replace yours, while all other hunks are to be added to your patch.

In my cursory test your patch seems to work well.

-- 
Enrico
diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am
index ec12adb883..7b5c569f32 100644
--- a/3rdparty/Makefile.am
+++ b/3rdparty/Makefile.am
@@ -1,6 +1,10 @@
 include $(top_srcdir)/config/common.am
 
-DIST_SUBDIRS = boost dtl hunspell mythes libiconv zlib
+DIST_SUBDIRS = boost dtl hunspell mythes libiconv zlib nod
+
+if USE_INCLUDED_NOD
+NOD = nod
+endif
 
 if USE_INCLUDED_BOOST
 BOOST = boost
@@ -26,7 +30,7 @@ if BUILD_INCLUDED_DTL
 DTL=dtl
 endif
 
-SUBDIRS = $(BOOST) $(DTL) $(HUNSPELL) $(MYTHES) $(ICONV) $(ZLIB)
+SUBDIRS = $(BOOST) $(DTL) $(HUNSPELL) $(MYTHES) $(ICONV) $(ZLIB) $(NOD)
 
 EXTRA_DIST = \
        scripts/evince_sync/evince_backward_search \
diff --git a/3rdparty/nod/Makefile.am b/3rdparty/nod/Makefile.am
index 0000000000..1b73dffdd9
--- /dev/null
+++ b/3rdparty/nod/Makefile.am
@@ -0,0 +1,4 @@
+include $(top_srcdir)/config/common.am
+
+EXTRA_DIST = nod \
+       README.md
diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index d07e1bcfcc..0e9ff19b5b 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -416,6 +416,34 @@ 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.hpp>],
+                   [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],[
diff --git a/configure.ac b/configure.ac
index 318986b4e2..9853fa53da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,6 +94,7 @@ AC_SUBST(LIBPSAPI)
 AC_CHECK_LIB(gdi32, main)
 AC_CHECK_LIB(ole32, main)
 
+LYX_USE_INCLUDED_NOD
 LYX_USE_INCLUDED_BOOST
 
 ### we need to know the byte order for unicode conversions
@@ -337,6 +338,7 @@ AC_CONFIG_FILES([Makefile \
       3rdparty/dtl/Makefile \
       3rdparty/hunspell/Makefile \
       3rdparty/mythes/Makefile \
+      3rdparty/nod/Makefile \
       3rdparty/libiconv/Makefile \
       $ICONV_ICONV_H_IN \
       3rdparty/zlib/Makefile \
diff --git a/src/Makefile.am b/src/Makefile.am
index 032b174cf3..31701f2fb1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,7 +5,7 @@ include $(top_srcdir)/config/common.am
 AM_CPPFLAGS += -I$(top_srcdir)/src
 AM_CPPFLAGS += $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES)
 AM_CPPFLAGS += $(ENCHANT_CFLAGS) $(HUNSPELL_CFLAGS) $(MYTHES_INCLUDES)
-AM_CPPFLAGS += $(QT_CPPFLAGS) $(QT_CORE_INCLUDES)
+AM_CPPFLAGS += $(NOD_INCLUDES) $(QT_CPPFLAGS) $(QT_CORE_INCLUDES)
 
 if BUILD_CLIENT_SUBDIR
 CLIENT = client
diff --git a/src/client/Makefile.am b/src/client/Makefile.am
index 5a6db831af..580556d6b1 100644
--- a/src/client/Makefile.am
+++ b/src/client/Makefile.am
@@ -9,7 +9,7 @@ bin_PROGRAMS = lyxclient
 EXTRA_DIST = lyxclient.1in CMakeLists.txt
 
 AM_CPPFLAGS += -I$(srcdir)/.. \
-       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES)
+       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES) $(NOD_INCLUDES)
 
 lyxclient_LDADD = \
        $(top_builddir)/src/support/liblyxsupport.a \
diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am
index 2acdeebb26..a8f233e25a 100644
--- a/src/frontends/Makefile.am
+++ b/src/frontends/Makefile.am
@@ -7,7 +7,7 @@ DIST_SUBDIRS = qt .
 noinst_LIBRARIES = liblyxfrontends.a
 
 AM_CPPFLAGS += -I$(srcdir)/.. \
-       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES)
+       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES) $(NOD_INCLUDES)
 
 liblyxfrontends_a_SOURCES = \
        alert.h \
diff --git a/src/frontends/qt/Makefile.am b/src/frontends/qt/Makefile.am
index 2a497af887..d559623310 100644
--- a/src/frontends/qt/Makefile.am
+++ b/src/frontends/qt/Makefile.am
@@ -37,7 +37,7 @@ AM_CPPFLAGS += \
        -I$(top_srcdir)/src/frontends \
        -I$(top_srcdir)/images \
        $(QT_INCLUDES) \
-       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES)
+       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES) $(NOD_INCLUDES)
 
 SOURCEFILES = \
        ButtonPolicy.cpp \
diff --git a/src/support/Makefile.am b/src/support/Makefile.am
index 83e67eabdf..3dedf57fea 100644
--- a/src/support/Makefile.am
+++ b/src/support/Makefile.am
@@ -29,7 +29,7 @@ liblyxsupport_a_DEPENDENCIES = $(MOCEDFILES)
 
 AM_CPPFLAGS += -I$(srcdir)/.. \
        $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES) \
-       $(QT_CPPFLAGS) $(QT_INCLUDES)
+       $(NOD_INCLUDES) $(QT_CPPFLAGS) $(QT_INCLUDES)
 
 liblyxsupport_a_SOURCES = \
        FileMonitor.h \
diff --git a/src/tex2lyx/Makefile.am b/src/tex2lyx/Makefile.am
index 923d6950ec..7ad91a0828 100644
--- a/src/tex2lyx/Makefile.am
+++ b/src/tex2lyx/Makefile.am
@@ -17,7 +17,7 @@ bin_PROGRAMS = tex2lyx
 
 AM_CPPFLAGS += -I$(top_srcdir)/src/tex2lyx \
        -I$(top_srcdir)/src -I$(top_builddir) -I$(top_builddir)/src \
-       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES)
+       $(BOOST_INCLUDES) $(ICONV_INCLUDES) $(ZLIB_INCLUDES) $(NOD_INCLUDES)
 
 TEST_FILES = \
        test/runtests.cmake \
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to