From: Matthew Fernandez Date: Mon, 21 Sep 2020 00:36:22 +0000 (-0700) Subject: force the C++ compiler to be used when linking C++-dependent targets X-Git-Tag: 2.46.0~20^2^2~64^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=189458f76da613cad933b070f751eefff91360c0;p=graphviz force the C++ compiler to be used when linking C++-dependent targets This looks pretty hacky, but is apparently the libtool-sanctioned way of doing this [0]. Related to #163. [0]: https://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries --- diff --git a/cmd/dot/Makefile.am b/cmd/dot/Makefile.am index 683df17a3..0661110c8 100644 --- a/cmd/dot/Makefile.am +++ b/cmd/dot/Makefile.am @@ -138,6 +138,11 @@ dot_static_LDADD += $(top_builddir)/plugin/lasi/.libs/libgvplugin_lasi_C.a $(LAS dot_builtins_LDADD += $(top_builddir)/plugin/lasi/libgvplugin_lasi.la $(LASI_LIBS) -lstdc++ endif +# add a non-existent C++ source to force the C++ compiler to be used for +# linking, so the C++ standard library is included for our C++ dependencies +nodist_EXTRA_dot_static_SOURCES = fake.cxx +nodist_EXTRA_dot_builtins_SOURCES = fake.cxx + EXTRA_DIST = dot.1 osage.1 patchwork.1 $(pdf) dot.vcxproj* DISTCLEANFILES = dot.1.pdf osage.1.pdf dot.1.ps osage.1.ps patchwork.1.pdf patchwork.1.ps diff --git a/cmd/edgepaint/Makefile.am b/cmd/edgepaint/Makefile.am index b803ad36b..735db97cc 100644 --- a/cmd/edgepaint/Makefile.am +++ b/cmd/edgepaint/Makefile.am @@ -39,6 +39,10 @@ edgepaint_LDADD = \ $(top_builddir)/lib/cdt/libcdt.la \ $(ANN_LIBS) -lstdc++ -lm +# add a non-existent C++ source to force the C++ compiler to be used for +# linking, so the C++ standard library is included for our C++ dependencies +nodist_EXTRA_edgepaint_SOURCES = fake.cxx + if HAVE_PS2PDF edgepaint.1.pdf: edgepaint.1.ps @PS2PDF@ $< $@ diff --git a/cmd/mingle/Makefile.am b/cmd/mingle/Makefile.am index 0b8cbc86e..9768b3e51 100644 --- a/cmd/mingle/Makefile.am +++ b/cmd/mingle/Makefile.am @@ -40,6 +40,10 @@ mingle_LDADD = \ $(top_builddir)/lib/cdt/libcdt.la \ $(ANN_LIBS) -lstdc++ -lm +# add a non-existent C++ source to force the C++ compiler to be used for +# linking, so the C++ standard library is included for our C++ dependencies +nodist_EXTRA_mingle_SOURCES = fake.cxx + if HAVE_PS2PDF mingle.1.pdf: mingle.1.ps @PS2PDF@ $< $@ diff --git a/cmd/tools/Makefile.am b/cmd/tools/Makefile.am index 424367e01..f1a0212f5 100644 --- a/cmd/tools/Makefile.am +++ b/cmd/tools/Makefile.am @@ -219,6 +219,10 @@ gvpack_LDADD = \ $(top_builddir)/lib/cdt/libcdt.la \ $(top_builddir)/plugin/neato_layout/libgvplugin_neato_layout.la +# add a non-existent C++ source to force the C++ compiler to be used for +# linking, so the C++ standard library is included for our C++ dependencies +nodist_EXTRA_gvpack_SOURCES = fake.cxx + if ENABLE_STATIC gvpack_static_SOURCES = gvpack.c gvpack_static_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=0 diff --git a/plugin/neato_layout/Makefile.am b/plugin/neato_layout/Makefile.am index 19c86c542..7acc47a45 100644 --- a/plugin/neato_layout/Makefile.am +++ b/plugin/neato_layout/Makefile.am @@ -40,6 +40,10 @@ libgvplugin_neato_layout_la_LIBADD = $(libgvplugin_neato_layout_C_la_LIBADD) \ $(top_builddir)/lib/pathplan/libpathplan.la \ $(GTS_LIBS) $(IPSEPCOLA_LIBS) $(MATH_LIBS) +# add a non-existent C++ source to force the C++ compiler to be used for +# linking, so the C++ standard library is included for our C++ dependencies +nodist_EXTRA_libgvplugin_neato_layout_la_SOURCES = fake.cxx + if WITH_SFDP libgvplugin_neato_layout_C_la_LIBADD += $(top_builddir)/lib/sfdpgen/libsfdpgen_C.la endif diff --git a/tclpkg/tcldot/Makefile.am b/tclpkg/tcldot/Makefile.am index 50393875e..5a844098f 100644 --- a/tclpkg/tcldot/Makefile.am +++ b/tclpkg/tcldot/Makefile.am @@ -105,6 +105,10 @@ endif libtcldot_builtin_la_LIBADD += $(EXPAT_LIBS) $(SOCKET_LIBS) $(IPSEPCOLA_LIBS) $(MATH_LIBS) +# add a non-existent C++ source to force the C++ compiler to be used for +# linking, so the C++ standard library is included for our C++ dependencies +nodist_EXTRA_libtcldot_builtin_la_SOURCES = fake.cxx + if WITH_TCL all-local: pkgIndex.tcl