From 57ca682ba6274996dee5de8076b0a26c84b1ff10 Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 19 Aug 2008 19:14:29 +0000 Subject: [PATCH] towards a fix for the tclstring problem (and strings in other bindings) --- configure.ac | 24 ++++++++++++++---------- graphviz.spec.in | 9 +++++++++ lib/Makefile.am | 3 ++- plugin/Makefile.am | 2 +- tclpkg/Makefile.am | 2 +- tclpkg/gdtclft/Makefile.am | 4 ++-- tclpkg/gv/Makefile.am | 2 +- tclpkg/tcldot/Makefile.am | 5 ++--- tclpkg/tcldot/tcldot.c | 5 +++-- tclpkg/tclpathplan/Makefile.am | 2 +- tclpkg/tkspline/Makefile.am | 6 +++--- 11 files changed, 39 insertions(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac index 3b017b7fd..0854c4528 100644 --- a/configure.ac +++ b/configure.ac @@ -1409,6 +1409,8 @@ if test "x$use_tcl" = "x"; then if test "x${TCL_SUPPORTS_STUBS}" = "x1"; then use_tcl="Yes" TCL_CFLAGS="${TCL_CFLAGS} -DUSE_TCL_STUBS" + AC_DEFINE_UNQUOTED(HAVE_TCL,1, + [Define if you have the tcl library]) else AC_MSG_WARN([Tcl does not have STUBs support, perhaps it is too old? The Tcl packages will not be built]) use_tcl="No (no STUBs support)" @@ -2866,6 +2868,8 @@ AC_CONFIG_FILES(Makefile lib/xdot/Makefile lib/topfish/Makefile lib/glcomp/Makefile + lib/tclstubs/Makefile + lib/tkstubs/Makefile macosx/Info.plist macosx/build/graphviz.pmdoc/01local.xml macosx/build/graphviz.pmdoc/02graphviz.xml @@ -2874,18 +2878,19 @@ AC_CONFIG_FILES(Makefile plugin/Makefile plugin/core/Makefile plugin/devil/Makefile - plugin/gdk_pixbuf/Makefile - plugin/rsvg/Makefile plugin/gd/Makefile - plugin/pango/Makefile - plugin/ming/Makefile - plugin/quartz/Makefile + plugin/gdk_pixbuf/Makefile plugin/gdiplus/Makefile plugin/glitz/Makefile + plugin/gtk/Makefile + plugin/ming/Makefile + plugin/pango/Makefile + plugin/quartz/Makefile + plugin/rsvg/Makefile + plugin/tcl/Makefile + plugin/xlib/Makefile plugin/dot_layout/Makefile plugin/neato_layout/Makefile - plugin/xlib/Makefile - plugin/gtk/Makefile cmd/Makefile cmd/dot/Makefile cmd/tools/Makefile @@ -2904,8 +2909,6 @@ AC_CONFIG_FILES(Makefile cmd/dotty/Makefile cmd/smyrna/Makefile tclpkg/Makefile - tclpkg/tclstubs/Makefile - tclpkg/tkstubs/Makefile tclpkg/tclhandle/Makefile tclpkg/gdtclft/Makefile tclpkg/gdtclft/demo/Makefile @@ -2993,10 +2996,11 @@ echo " gdiplus: $use_gdiplus" echo " gdk_pixbuf: $use_gdk_pixbuf" echo " glitz: $use_glitz" echo " gtk: $use_gtk" -echo " pangocairo: $use_pangocairo" echo " ming: $use_ming" +echo " pangocairo: $use_pangocairo" echo " quartz: $use_quartz" echo " rsvg: $use_rsvg" +echo " tcl: $use_tcl" echo " xlib: $use_xlib" echo "" echo "language extensions:" diff --git a/graphviz.spec.in b/graphviz.spec.in index e11c21b53..71b647e95 100644 --- a/graphviz.spec.in +++ b/graphviz.spec.in @@ -310,6 +310,7 @@ fi %{_datadir}/graphviz/smyrna %{_datadir}/graphviz/examples %endif +%exclude %{_libdir}/graphviz/libgvplugin_tcl.* #-- graphviz-gd rpm -------------------------------------------------- %package gd @@ -590,6 +591,7 @@ Various tcl packages (extensions) for the graphviz tools. %defattr(-,root,root,-) %dir %{_libdir}/graphviz/tcl %{_libdir}/graphviz/tcl/* +%{_libdir}/graphviz/libgvplugin_tcl.* %{_libdir}/tcl*/* %{_datadir}/graphviz/demo/*.tcl* %{_datadir}/graphviz/demo/*_data @@ -599,6 +601,13 @@ Various tcl packages (extensions) for the graphviz tools. %{_mandir}/mann/tkspline.n* %endif +# run "dot -c" to generate plugin config in %{_libdir}/graphviz/config +%post tcl +LD_LIBRARY_PATH=$RPM_INSTALL_PREFIX0/%{_lib} $RPM_INSTALL_PREFIX0/bin/dot -c + +%postun tcl +[ -x $RPM_INSTALL_PREFIX0/bin/dot ] && LD_LIBRARY_PATH=$RPM_INSTALL_PREFIX0/%{_lib} $RPM_INSTALL_PREFIX0/bin/dot -c || : + #-- graphviz-devel rpm -------------------------------------------- %package devel Group: Development/Libraries diff --git a/lib/Makefile.am b/lib/Makefile.am index 6aaf34e53..d33209629 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = cdt graph agraph gd pathplan agutil sfio vmalloc ast vpsc \ circogen dotgen fdpgen neatogen twopigen sparse sfdpgen \ - patchwork common pack gvc ingraphs expr cgraph xdot topfish glcomp + patchwork common pack gvc ingraphs expr cgraph xdot topfish glcomp \ + tclstubs tkstubs EXTRA_DIST = Makefile.old diff --git a/plugin/Makefile.am b/plugin/Makefile.am index 677aae06b..02b60153e 100644 --- a/plugin/Makefile.am +++ b/plugin/Makefile.am @@ -1,6 +1,6 @@ # $Id$ $Revision$ ## Process this file with automake to produce Makefile.in -SUBDIRS = core gd pango dot_layout neato_layout xlib gtk ming devil gdk_pixbuf rsvg quartz gdiplus glitz +SUBDIRS = core devil gd gdk_pixbuf gdiplus glitz gtk ming pango quartz rsvg tcl xlib dot_layout neato_layout EXTRA_DIST = Makefile.old diff --git a/tclpkg/Makefile.am b/tclpkg/Makefile.am index a9ce0a638..6533e3f0d 100644 --- a/tclpkg/Makefile.am +++ b/tclpkg/Makefile.am @@ -22,7 +22,7 @@ if WITH_TCL pkgindex_DATA = pkgIndex.tcl endif -SUBDIRS = tclstubs tkstubs tclhandle gdtclft tcldot tclpathplan tkspline gv +SUBDIRS = tclhandle gdtclft tcldot tclpathplan tkspline gv pkgIndex.tcl: @TCL_PKGINDEX@ @TCL_PKGINDEX_GD@ @TCL_PKGINDEX_SWIG@ @TK_PKGINDEX@ echo "# end" >end diff --git a/tclpkg/gdtclft/Makefile.am b/tclpkg/gdtclft/Makefile.am index 2bfed87cb..be74bfa25 100644 --- a/tclpkg/gdtclft/Makefile.am +++ b/tclpkg/gdtclft/Makefile.am @@ -34,13 +34,13 @@ if WITH_LIBGD if WITH_MYLIBGD libgdtclft_la_LIBADD = \ $(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \ - $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \ + $(top_builddir)/lib/tclstubs/libtclstubs_C.la \ $(top_builddir)/lib/gd/libgvgd_C.la \ @ICONV_LIBS@ @FONTCONFIG_LIBS@ @FREETYPE2_LIBS@ @JPEG_LIBS@ @PNG_LIBS@ @Z_LIBS@ @MATH_LIBS@ else libgdtclft_la_LIBADD = \ $(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \ - $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \ + $(top_builddir)/lib/tclstubs/libtclstubs_C.la \ @GD_LIBS@ @ICONV_LIBS@ @FONTCONFIG_LIBS@ @FREETYPE2_LIBS@ @JPEG_LIBS@ @PNG_LIBS@ @Z_LIBS@ @MATH_LIBS@ endif diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index 4e1349eac..8124ef482 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -191,7 +191,7 @@ pkgtcldir = $(pkglibdir)/tcl TCL_data = nodist_libgv_tcl_la_SOURCES = gv_tcl.cpp $(TCL_data) libgv_tcl_la_SOURCES = $(BASESOURCES) gv_dummy_init.cpp -libgv_tcl_la_LIBADD = $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la $(BASELIBS) $(TCL_LIBS) +libgv_tcl_la_LIBADD = $(top_builddir)/lib/tclstubs/libtclstubs_C.la $(BASELIBS) $(TCL_LIBS) libgv_tcl_la_LDFLAGS = -module -avoid-version libgv_tcl_la_CPPFLAGS = $(AM_CPPFLAGS) $(TCL_INCLUDES) $(TCL_data): gv_tcl.cpp diff --git a/tclpkg/tcldot/Makefile.am b/tclpkg/tcldot/Makefile.am index 41c0e1229..355535851 100644 --- a/tclpkg/tcldot/Makefile.am +++ b/tclpkg/tcldot/Makefile.am @@ -41,7 +41,7 @@ libtcldot_la_SOURCES = tcldot.c $(CODEGENS) $(GDTCLFT) libtcldot_la_LDFLAGS = -no-undefined libtcldot_la_LIBADD = $(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \ - $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \ + $(top_builddir)/lib/tclstubs/libtclstubs_C.la \ $(top_builddir)/lib/gvc/libgvc.la # GDTCLFT requires gd libs to be builtin @@ -64,10 +64,9 @@ libtcldot_builtin_la_LDFLAGS = libtcldot_builtin_la_LIBADD = \ $(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \ - $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \ $(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 \ + $(top_builddir)/plugin/tcl/libgvplugin_tcl_C.la \ $(top_builddir)/lib/gvc/libgvc_C.la \ $(top_builddir)/lib/graph/libgraph_C.la \ $(top_builddir)/lib/cdt/libcdt_C.la \ diff --git a/tclpkg/tcldot/tcldot.c b/tclpkg/tcldot/tcldot.c index 96a046489..8327b2267 100644 --- a/tclpkg/tcldot/tcldot.c +++ b/tclpkg/tcldot/tcldot.c @@ -1080,9 +1080,9 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp, } #endif } - rc = gvjobs_output_langname(gvc, "tk"); + rc = gvjobs_output_langname(gvc, "tcl_string:tk"); if (rc == NO_SUPPORT) { - Tcl_AppendResult(interp, " Format: \"tk\" not recognized.\n", + Tcl_AppendResult(interp, " Format: \"tcl_string:tk\" not recognized.\n", (char *) 0); return TCL_ERROR; } @@ -1091,6 +1091,7 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp, job->imagedata = canvas; job->context = (void *)interp; job->external_context = TRUE; + job->output_file = stdout; /* make sure that layout is done */ g = g->root; diff --git a/tclpkg/tclpathplan/Makefile.am b/tclpkg/tclpathplan/Makefile.am index 589c74607..9867c8a6f 100644 --- a/tclpkg/tclpathplan/Makefile.am +++ b/tclpkg/tclpathplan/Makefile.am @@ -21,7 +21,7 @@ libtclplan_la_SOURCES = find_ints.c intersect.c makecw.c tclpathplan.c wrapper.c libtclplan_la_LDFLAGS = -no-undefined libtclplan_la_LIBADD = \ $(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \ - $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \ + $(top_builddir)/lib/tclstubs/libtclstubs_C.la \ $(top_builddir)/lib/pathplan/libpathplan.la if WITH_TCL diff --git a/tclpkg/tkspline/Makefile.am b/tclpkg/tkspline/Makefile.am index 3321343c0..9f595887b 100644 --- a/tclpkg/tkspline/Makefile.am +++ b/tclpkg/tkspline/Makefile.am @@ -14,7 +14,7 @@ AM_CPPFLAGS = \ -I@TK_SRC_DIR@/generic \ -I@TCL_SRC_DIR@/generic \ @TCL_INCLUDES@ @TCLINT_INCLUDES@ \ - @TK_INCLUDES@ @TKINT_INCLUDES@ -I$(top_srcdir)/tclpkg/tkstubs + @TK_INCLUDES@ @TKINT_INCLUDES@ -I$(top_srcdir)/lib/tkstubs AM_CFLAGS = @X_CFLAGS@ @TCL_CFLAGS@ @TK_CFLAGS@ @TK_DEFS@ \ -UPACKAGE_NAME -UPACKAGE_STRING -UPACKAGE_TARNAME -UPACKAGE_VERSION @@ -28,8 +28,8 @@ endif libtkspline_la_LDFLAGS = -no-undefined libtkspline_la_SOURCES = tkspline.c libtkspline_la_LIBADD = \ - $(top_builddir)/tclpkg/tkstubs/libtkstubs_C.la \ - $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la @TK_LIB_SPEC@ + $(top_builddir)/lib/tkstubs/libtkstubs_C.la \ + $(top_builddir)/lib/tclstubs/libtclstubs_C.la @TK_LIB_SPEC@ if WITH_TK all-local: pkgIndex.tcl -- 2.40.0