diff -Nurd graphviz-2.49.3.orig/cmd/smyrna/Makefile.in graphviz-2.49.3/cmd/smyrna/Makefile.in
--- graphviz-2.49.3.orig/cmd/smyrna/Makefile.in	2021-10-22 20:37:57.000000000 -0400
+++ graphviz-2.49.3/cmd/smyrna/Makefile.in	2021-10-31 21:58:16.000000000 -0400
@@ -670,7 +670,7 @@
 		$(top_builddir)/lib/expr/libexpr_C.la \
 		$(top_builddir)/lib/ingraphs/libingraphs_C.la \
 		$(top_builddir)/lib/neatogen/libneatogen_C.la \
-		$(GTK_LIBS) $(GLUT_LIBS) $(GTKGLEXT_LIBS) $(GLADE_LIBS) $(X_LIBS) $(EXPAT_LIBS) $(GTS_LIBS) $(MATH_LIBS) $(EXTRA_SMYRNA_LDFLAGS)
+		$(GTK_LIBS) $(GLUT_LIBS) $(GTKGLEXT_LIBS) $(GLADE_LIBS) $(X_LIBS) $(EXPAT_LIBS) $(GTS_LIBS) $(MATH_LIBS) $(EXTRA_SMYRNA_LDFLAGS) -lGLU
 
 smyrna_static_SOURCES = $(smyrna_SOURCES)
 smyrna_static_LDADD = $(top_builddir)/lib/cgraph/libcgraph_C.la \
diff -Nurd graphviz-2.49.3.orig/configure graphviz-2.49.3/configure
--- graphviz-2.49.3.orig/configure	2021-10-22 20:37:54.000000000 -0400
+++ graphviz-2.49.3/configure	2021-10-31 21:58:16.000000000 -0400
@@ -12117,7 +12117,7 @@
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_search_path_spec="/lib /usr/lib @FINKPREFIX@/lib"
 fi
 library_names_spec=
 libname_spec='lib$name'
@@ -12401,8 +12401,8 @@
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
 
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  sys_lib_search_path_spec="@FINKPREFIX@/lib $sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec='@FINKPREFIX@/lib /lib /usr/lib'
   ;;
 
 dgux*)
@@ -17388,7 +17388,7 @@
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
 
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  sys_lib_dlsearch_path_spec='@FINKPREFIX@/lib /lib /usr/lib'
   ;;
 
 dgux*)
@@ -23456,7 +23456,7 @@
 	      RUBY_CFLAGS=`echo $RUBY_CFLAGS | sed 's/powerpc/universal/'`
 	    fi
             RUBY_LIBS="-L`$RUBY $srcdir/config/config_ruby.rb lib` `$RUBY -rrbconfig -e \"puts RbConfig::CONFIG['LIBRUBYARG_SHARED']\"`"
-            RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb vendorarchdir`"
+            RUBY_INSTALL_DIR="@FINKPREFIX@/lib/@PKGVERSION@/graphviz/ruby"
 	    if test "x$RUBY_INSTALL_DIR" = "x"; then
 	  	  RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb sitearchdir`"
 	    fi
@@ -23526,7 +23526,7 @@
 	      RUBY_CFLAGS=`echo $RUBY_CFLAGS | sed 's/powerpc/universal/'`
 	    fi
             RUBY_LIBS="-L`$RUBY $srcdir/config/config_ruby.rb lib` `$RUBY -rrbconfig -e \"puts RbConfig::CONFIG['LIBRUBYARG_SHARED']\"`"
-            RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb vendorarchdir`"
+            RUBY_INSTALL_DIR="@FINKPREFIX@/lib/@PKGVERSION@/graphviz/ruby"
 	    if test "x$RUBY_INSTALL_DIR" = "x"; then
 	  	  RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb sitearchdir`"
 	    fi
@@ -23592,7 +23592,7 @@
           if test "x$RUBY" = "x"; then
             use_ruby="No (ruby not available)"
           else
-            RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb vendorarchdir`"
+            RUBY_INSTALL_DIR="@FINKPREFIX@/lib/@PKGVERSION@/graphviz/ruby"
 	  fi
 
 fi
@@ -23707,7 +23707,7 @@
 	      RUBY_CFLAGS=`echo $RUBY_CFLAGS | sed 's/powerpc/universal/'`
 	    fi
             RUBY_LIBS="-L`$RUBY $srcdir/config/config_ruby.rb lib` `$RUBY -rrbconfig -e \"puts RbConfig::CONFIG['LIBRUBYARG_SHARED']\"`"
-            RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb vendorarchdir`"
+            RUBY_INSTALL_DIR="@FINKPREFIX@/lib/@PKGVERSION@/graphviz/ruby"
 	    if test "x$RUBY_INSTALL_DIR" = "x"; then
 	  	  RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb sitearchdir`"
 	    fi
@@ -23777,7 +23777,7 @@
 	      RUBY_CFLAGS=`echo $RUBY_CFLAGS | sed 's/powerpc/universal/'`
 	    fi
             RUBY_LIBS="-L`$RUBY $srcdir/config/config_ruby.rb lib` `$RUBY -rrbconfig -e \"puts RbConfig::CONFIG['LIBRUBYARG_SHARED']\"`"
-            RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb vendorarchdir`"
+            RUBY_INSTALL_DIR="@FINKPREFIX@/lib/@PKGVERSION@/graphviz/ruby"
 	    if test "x$RUBY_INSTALL_DIR" = "x"; then
 	  	  RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb sitearchdir`"
 	    fi
@@ -23843,7 +23843,7 @@
           if test "x$RUBY" = "x"; then
             use_ruby="No (ruby not available)"
           else
-            RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb vendorarchdir`"
+            RUBY_INSTALL_DIR="@FINKPREFIX@/lib/@PKGVERSION@/graphviz/ruby"
 	  fi
 
 fi
@@ -23894,7 +23894,7 @@
         if test "x$RUBY" = "x"; then
           use_ruby="No (ruby not available)"
         else
-          RUBY_INSTALL_DIR="`$RUBY $srcdir/config/config_ruby.rb vendorarchdir`"
+          RUBY_INSTALL_DIR="@FINKPREFIX@/lib/@PKGVERSION@/graphviz/ruby"
 	fi
 
 fi
diff -Nurd graphviz-2.49.3.orig/lib/dotgen/compound.c graphviz-2.49.3/lib/dotgen/compound.c
--- graphviz-2.49.3.orig/lib/dotgen/compound.c	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/lib/dotgen/compound.c	2021-10-31 21:58:16.000000000 -0400
@@ -177,6 +177,9 @@
 	return tmin;
 
     no_cross = countVertCross(pts, xcoord);
+	if (tmin >= tmax)
+		return -1.0;
+
     if (no_cross == 0)
 	return -1.0;
 
@@ -219,6 +222,9 @@
 	return tmin;
 
     no_cross = countHorzCross(pts, ycoord);
+	if (tmin >= tmax)
+		return -1.0;
+
     if (no_cross == 0)
 	return -1.0;
 
diff -Nurd graphviz-2.49.3.orig/lib/gvc/gvcext.h graphviz-2.49.3/lib/gvc/gvcext.h
--- graphviz-2.49.3.orig/lib/gvc/gvcext.h	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/lib/gvc/gvcext.h	2021-10-31 21:58:16.000000000 -0400
@@ -12,6 +12,8 @@
 
 #pragma once
 
+#include <ltdl.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -52,10 +54,14 @@
     typedef struct GVG_s GVG_t;
     typedef struct GVC_s GVC_t;
 
+#if 0
     typedef struct {
 	const char *name;
 	void* address;
     } lt_symlist_t;
+#else
+	typedef	const lt_dlsymlist	lt_symlist_t;	// libtool2's ltdl.h
+#endif
 
     typedef struct gvplugin_available_s gvplugin_available_t;
 
diff -Nurd graphviz-2.49.3.orig/lib/neatogen/adjust.c graphviz-2.49.3/lib/neatogen/adjust.c
--- graphviz-2.49.3.orig/lib/neatogen/adjust.c	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/lib/neatogen/adjust.c	2021-10-31 21:58:16.000000000 -0400
@@ -1072,7 +1072,7 @@
 int 
 removeOverlapWith (graph_t * G, adjust_data* am)
 {
-    int ret, nret;
+    int ret = 0, nret;
 
     if (agnnodes(G) < 2)
 	return 0;
diff -Nurd graphviz-2.49.3.orig/lib/ortho/partition.c graphviz-2.49.3/lib/ortho/partition.c
--- graphviz-2.49.3.orig/lib/ortho/partition.c	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/lib/ortho/partition.c	2021-10-31 21:58:16.000000000 -0400
@@ -596,7 +596,7 @@
 monotonate_trapezoids(int nsegs, segment_t*seg, trap_t* tr, 
     int flip, boxf* decomp)
 {
-    int i, size;
+    int i, size = 0;
     int tr_start;
     int tr_size = TRSIZE(nsegs);
     int* visited = N_NEW(tr_size,int);
diff -Nurd graphviz-2.49.3.orig/plugin/gd/Makefile.in graphviz-2.49.3/plugin/gd/Makefile.in
--- graphviz-2.49.3.orig/plugin/gd/Makefile.in	2021-10-22 20:37:59.000000000 -0400
+++ graphviz-2.49.3/plugin/gd/Makefile.in	2021-10-31 21:58:16.000000000 -0400
@@ -89,7 +89,6 @@
 build_triplet = @build@
 host_triplet = @host@
 @WITH_LIBGD_TRUE@@WITH_WIN32_TRUE@am__append_1 = -no-undefined
-@WITH_LIBGD_TRUE@@WITH_WIN32_TRUE@am__append_2 = $(top_builddir)/lib/cgraph/libcgraph.la $(top_builddir)/lib/pathplan/libpathplan.la
 @WITH_DARWIN9_TRUE@@WITH_LIBGD_TRUE@am__append_3 = -Wl,-exported_symbol,_gvplugin_gd_LTX_library
 subdir = plugin/gd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -599,7 +598,7 @@
 @WITH_LIBGD_TRUE@	$(top_builddir)/lib/cgraph/libcgraph.la \
 @WITH_LIBGD_TRUE@	$(top_builddir)/lib/cdt/libcdt.la \
 @WITH_LIBGD_TRUE@	@PANGOCAIRO_LIBS@ @GDLIB_LIBS@ @MATH_LIBS@ \
-@WITH_LIBGD_TRUE@	$(am__append_2)
+@WITH_LIBGD_TRUE@	$(top_builddir)/lib/pathplan/libpathplan.la
 @WITH_LIBGD_TRUE@libgvplugin_gd_la_DEPENDENCIES = $(top_builddir)/lib/gvc/libgvc.la
 EXTRA_DIST = gvplugin_gd.vcxproj*
 all: all-am
diff -Nurd graphviz-2.49.3.orig/plugin/gtk/Makefile.in graphviz-2.49.3/plugin/gtk/Makefile.in
--- graphviz-2.49.3.orig/plugin/gtk/Makefile.in	2021-10-22 20:37:59.000000000 -0400
+++ graphviz-2.49.3/plugin/gtk/Makefile.in	2021-10-31 21:58:16.000000000 -0400
@@ -601,7 +601,7 @@
 libgvplugin_gtk_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO@ \
 	$(am__append_1) $(am__append_2)
 libgvplugin_gtk_la_SOURCES = $(libgvplugin_gtk_C_la_SOURCES)
-libgvplugin_gtk_la_LIBADD = $(GTK_LIBS)
+libgvplugin_gtk_la_LIBADD = $(GTK_LIBS) $(X_LIBS) -lX11
 EXTRA_DIST = gtk.glade gtk.gladep 
 all: all-am
 
diff -Nurd graphviz-2.49.3.orig/plugin/ming/Makefile.in graphviz-2.49.3/plugin/ming/Makefile.in
--- graphviz-2.49.3.orig/plugin/ming/Makefile.in	2021-10-22 20:38:00.000000000 -0400
+++ graphviz-2.49.3/plugin/ming/Makefile.in	2021-10-31 21:58:16.000000000 -0400
@@ -593,7 +593,7 @@
 libgvplugin_ming_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO@ \
 	$(am__append_1) $(am__append_2)
 libgvplugin_ming_la_SOURCES = $(libgvplugin_ming_C_la_SOURCES)
-libgvplugin_ming_la_LIBADD = @MING_LIBS@ @MATH_LIBS@
+libgvplugin_ming_la_LIBADD = $(top_builddir)/lib/gvc/libgvc.la @MING_LIBS@ @MATH_LIBS@
 EXTRA_DIST = Bitstream_Vera_Sans.fdb Bitstream_Vera_Serif.fdb
 all: all-am
 
diff -Nurd graphviz-2.49.3.orig/plugin/ming/gvrender_ming.c graphviz-2.49.3/plugin/ming/gvrender_ming.c
--- graphviz-2.49.3.orig/plugin/ming/gvrender_ming.c	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/plugin/ming/gvrender_ming.c	2021-10-31 21:58:16.000000000 -0400
@@ -13,6 +13,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <gvc/gvplugin_render.h>
+#include "gvcint.h"
+#include "gvcproc.h"
 
 /* from config.h - would conflict with ming.h definitions */
 #undef PACKAGE
@@ -83,7 +85,6 @@
     SWFMovie_nextFrame(movie);
 }
 
-extern char* gvconfig_libdir(void);
 #define FONT "Bitstream_Vera_Serif.fdb"
 
 static void ming_textspan(GVJ_t * job, pointf p, textspan_t * span)
@@ -100,7 +101,7 @@
 
 /* FIXME - hardcoded to a Times-like font */
     if (font == NULL) {
-    	libdir=gvconfig_libdir();
+    	libdir=gvconfig_libdir(job->gvc);
 	font_file_name = malloc(strlen(libdir)+strlen(FONT)+2);
 	strcpy(font_file_name, libdir);
 	strcat(font_file_name, "/");
diff -Nurd graphviz-2.49.3.orig/plugin/quartz/Makefile.in graphviz-2.49.3/plugin/quartz/Makefile.in
--- graphviz-2.49.3.orig/plugin/quartz/Makefile.in	2021-10-22 20:38:00.000000000 -0400
+++ graphviz-2.49.3/plugin/quartz/Makefile.in	2021-10-31 21:58:16.000000000 -0400
@@ -618,7 +618,7 @@
 libgvplugin_quartz_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO@ \
 	-framework CoreFoundation $(am__append_1) $(am__append_2)
 libgvplugin_quartz_la_SOURCES = $(libgvplugin_quartz_C_la_SOURCES)
-libgvplugin_quartz_la_LIBADD = @QUARTZ_LIBS@
+libgvplugin_quartz_la_LIBADD = $(top_builddir)/lib/gvc/libgvc.la $(top_builddir)/lib/cgraph/libcgraph.la @QUARTZ_LIBS@
 AM_LIBTOOLFLAGS = --tag=CC
 all: all-am
 
diff -Nurd graphviz-2.49.3.orig/plugin/quartz/gvloadimage_quartz.c graphviz-2.49.3/plugin/quartz/gvloadimage_quartz.c
--- graphviz-2.49.3.orig/plugin/quartz/gvloadimage_quartz.c	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/plugin/quartz/gvloadimage_quartz.c	2021-10-31 21:58:16.000000000 -0400
@@ -14,6 +14,10 @@
 #include <stddef.h>
 #include <string.h>
 
+#include <CoreGraphics/CGDataProvider.h>
+#include <CoreGraphics/CGImage.h>
+#include <CGGLContext.h>
+
 #include <gvc/gvplugin_loadimage.h>
 
 #include "gvplugin_quartz.h"
diff -Nurd graphviz-2.49.3.orig/plugin/quartz/gvplugin_quartz.h graphviz-2.49.3/plugin/quartz/gvplugin_quartz.h
--- graphviz-2.49.3.orig/plugin/quartz/gvplugin_quartz.h	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/plugin/quartz/gvplugin_quartz.h	2021-10-31 21:58:16.000000000 -0400
@@ -10,7 +10,10 @@
 
 #pragma once
 
-#include <Availability.h>
+#include <CoreGraphics/CoreGraphics.h>
+#include <CoreGraphics/CGDataConsumer.h>
+#include <CoreGraphics/CGFont.h>
+#include <AvailabilityMacros.h>
 
 #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
 #include <CoreGraphics/CoreGraphics.h>
diff -Nurd graphviz-2.49.3.orig/plugin/quartz/gvrender_quartz.c graphviz-2.49.3/plugin/quartz/gvrender_quartz.c
--- graphviz-2.49.3.orig/plugin/quartz/gvrender_quartz.c	2021-10-22 20:37:44.000000000 -0400
+++ graphviz-2.49.3/plugin/quartz/gvrender_quartz.c	2021-10-31 21:58:16.000000000 -0400
@@ -13,6 +13,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <CoreGraphics/CGContext.h>
+#include <CoreGraphics/CGPDFContext.h>
+
 #if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
 #include <mach/mach_host.h>
 #include <sys/mman.h>
@@ -26,6 +29,11 @@
 #include <gvc/gvplugin_render.h>
 #include <cgraph/cgraph.h>
 
+#ifndef CGFLOAT_DEFINED
+/* nowhere defined, for Carbon Emacs the same work-around */
+typedef float CGFloat;
+#endif
+
 #include "gvplugin_quartz.h"
 
 static CGFloat dashed[] = { 6.0 };
diff -Nurd graphviz-2.49.3.orig/tclpkg/Makefile.in graphviz-2.49.3/tclpkg/Makefile.in
--- graphviz-2.49.3.orig/tclpkg/Makefile.in	2021-10-22 20:38:00.000000000 -0400
+++ graphviz-2.49.3/tclpkg/Makefile.in	2021-10-31 22:08:38.000000000 -0400
@@ -990,7 +990,7 @@
 @ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@	-mkdir -p $(DESTDIR)@RUBY_INSTALL_DIR@;
 @ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@	if test -w $(DESTDIR)@RUBY_INSTALL_DIR@; then \
 @ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@		(cd $(DESTDIR)@RUBY_INSTALL_DIR@; \
-@ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@			cp -f $(DESTDIR)$(pkgrubydir)/libgv_ruby.so gv.so;) \
+@ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@			ln -fs $(pkgrubydir)/libgv_ruby.so gv.so;) \
 @ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@	else \
 @ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@		echo "Warning: @RUBY_INSTALL_DIR@ is not writable."; \
 @ENABLE_SHARED_TRUE@@WITH_RUBY_TRUE@		echo "Skipping system installation of ruby binding."; \
diff -Nurd graphviz-2.49.3.orig/tclpkg/tcldot/Makefile.in graphviz-2.49.3/tclpkg/tcldot/Makefile.in
--- graphviz-2.49.3.orig/tclpkg/tcldot/Makefile.in	2021-10-22 20:38:01.000000000 -0400
+++ graphviz-2.49.3/tclpkg/tcldot/Makefile.in	2021-10-31 21:58:16.000000000 -0400
@@ -726,8 +726,8 @@
 	tcldot_builtins.c $(GDTCLFT)
 
 libtcldot_builtin_la_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=1
-libtcldot_builtin_la_LDFLAGS = 
-libtcldot_builtin_la_LIBADD = $(TCLHANDLE_LIBS) \
+libtcldot_builtin_la_LDFLAGS = -no-undefined
+libtcldot_builtin_la_LIBADD = $(TCLHANDLE_LIBS) $(GDTCLFT_LIBS) \
 	$(top_builddir)/plugin/dot_layout/libgvplugin_dot_layout_C.la \
 	$(top_builddir)/plugin/neato_layout/libgvplugin_neato_layout_C.la \
 	$(top_builddir)/plugin/core/libgvplugin_core_C.la \
@@ -737,7 +737,7 @@
 	$(top_builddir)/lib/pathplan/libpathplan_C.la \
 	$(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la $(GTS_LIBS) \
 	$(am__append_2) $(am__append_3) $(EXPAT_LIBS) $(SOCKET_LIBS) \
-	$(IPSEPCOLA_LIBS) $(MATH_LIBS)
+	$(IPSEPCOLA_LIBS) $(MATH_LIBS) $(am__append_1)
 
 # 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
