]> granicus.if.org Git - graphviz/commitdiff
force the C++ compiler to be used when linking C++-dependent targets
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 21 Sep 2020 00:36:22 +0000 (17:36 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 27 Sep 2020 02:00:01 +0000 (19:00 -0700)
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

cmd/dot/Makefile.am
cmd/edgepaint/Makefile.am
cmd/mingle/Makefile.am
cmd/tools/Makefile.am
plugin/neato_layout/Makefile.am
tclpkg/tcldot/Makefile.am

index 683df17a37eec9b439bab01697dca3e6acd2aa45..0661110c8d77e933ffc8ccc829a43468538607b0 100644 (file)
@@ -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
index b803ad36bdf47bd95a0ab849fd2d32027756e27c..735db97cc47bd1840244572d9a652f1713bbd0e6 100644 (file)
@@ -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@ $< $@
index 0b8cbc86e90b51544503fc3ba3dd5e4b017a0193..9768b3e516fea805b73238335a097465a4cb0841 100644 (file)
@@ -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@ $< $@
index 424367e01424bc54121e2e83f103abdcd86bcf57..f1a0212f5d24e7514803faf1e3b733309baf1f2d 100644 (file)
@@ -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
index 19c86c5429c8f3e5f5599300fc19471bd27973a6..7acc47a45a606b4c929ae099b03fa049826c5ee5 100644 (file)
@@ -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
index 50393875e44e58cb755d95dbbe9dc00480293e84..5a844098fc2ced2d7c824867f7ce0f3bd804f055 100644 (file)
@@ -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