From: ellson Date: Wed, 9 Feb 2011 19:04:40 +0000 (+0000) Subject: not yet complete changes for "go" language support X-Git-Tag: LAST_LIBGRAPH~32^2~1064 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=548a45eedf0f9e5ecfe3049f2f5d221469d4d3cf;p=graphviz not yet complete changes for "go" language support --- diff --git a/configure.ac b/configure.ac index e1b492e6d..d15c37ead 100644 --- a/configure.ac +++ b/configure.ac @@ -612,6 +612,50 @@ else fi AM_CONDITIONAL(WITH_SHARP, [test "x$use_sharp" = "xYes"]) +dnl ----------------------------------- +dnl INCLUDES and LIBS for GO + +AC_ARG_ENABLE(go, + [AS_HELP_STRING([--enable-go=no],[go language bindings])], + [], [enable_go=no]) + +if test "x$enable_go" != "xyes"; then + use_go="No (disabled by default - experimental)" +else + if test "x$use_swig" != "xYes"; then + use_go="No (swig not available)" + else + if test `$SWIG -help 2>&1 | $GREP -c '\-go* *- Generate'` = 0 ; then + use_go="No (swig does not support -go option)" + else + AC_CHECK_PROG(GO,6g,8g) + if test "x$GO" = "x"; then + use_go="No (GO compiler not available)" + else + GO_INCLUDES= +# GO_INSTALL_DIR="/usr/lib${LIBPOSTFIX}/go/modules" +# GO_INSTALL_DATADIR="/usr/share/go" + GO_LIBS= +# save_CPPFLAGS=$CPPFLAGS +# CPPFLAGS="$CPPFLAGS $GO_INCLUDES" +# AC_CHECK_HEADER(go.h,,[ +# use_go="No (missing header)" +# GO= +# ]) +# CPPFLAGS=$save_CPPFLAGS + if test "x$GO" != "x"; then + use_go="Yes" +# AC_SUBST(GO_INSTALL_DATADIR) +# AC_SUBST(GO_INSTALL_DIR) + AC_SUBST(GO_INCLUDES) + AC_SUBST(GO_LIBS) + fi + fi + fi + fi +fi +AM_CONDITIONAL(WITH_GO, [test "x$use_go" = "xYes"]) + dnl ----------------------------------- dnl INCLUDES and LIBS for GUILE @@ -3303,6 +3347,7 @@ echo " xlib: $use_xlib" echo "" echo "language extensions:" echo " gv_sharp: $use_sharp" +echo " gv_go: $use_go" echo " gv_guile: $use_guile" echo " gv_io: $use_io" echo " gv_java: $use_java" diff --git a/tclpkg/Makefile.am b/tclpkg/Makefile.am index a8c5a180d..4796b632f 100644 --- a/tclpkg/Makefile.am +++ b/tclpkg/Makefile.am @@ -2,6 +2,7 @@ ## Process this file with automake to produce Makefile.in pkgsharpdir = $(pkglibdir)/sharp +pkggodir = $(pkglibdir)/go pkgguiledir = $(pkglibdir)/guile pkgiodir = $(pkglibdir)/io pkgjavadir = $(pkglibdir)/java @@ -166,6 +167,7 @@ endif # has installed a system copy uninstall-hook: rm -rf $(DESTDIR)$(pkgsharpdir); + rm -rf $(DESTDIR)$(pkggodir); rm -rf $(DESTDIR)$(pkgguiledir); rm -rf $(DESTDIR)$(pkgiodir); rm -rf $(DESTDIR)$(pkgjavadir); diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index ead6df141..bcc3d264b 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -39,6 +39,17 @@ $(SHARP_data): gv_sharp.cpp gv_sharp.cpp: gv.i $(SWIG) -c++ -csharp -namespace gv -o gv_sharp.cpp $(srcdir)/gv.i +pkggodir = $(pkglibdir)/go +GO_data = +nodist_libgv_go_la_SOURCES = gv_go.cpp $(GO_data) +libgv_go_la_SOURCES = $(BASESOURCES) gv_dummy_init.c +libgv_go_la_LIBADD = $(BASELIBS) $(GO_LIBS) +libgv_go_la_LDFLAGS = -module -avoid-version +libgv_go_la_CPPFLAGS = $(BASECPPFLAGS) $(GO_INCLUDES) +$(GO_data): gv_go.cpp +gv_go.cpp: gv.i + $(SWIG) -c++ -go -o gv_go.cpp $(srcdir)/gv.i + pkgguiledir = $(pkglibdir)/guile GUILE_data = nodist_libgv_guile_la_SOURCES = gv_guile.cpp $(GUILE_data) @@ -259,6 +270,13 @@ pdf_DATA += gv.3sharp.pdf pkgsharp_LTLIBRARIES = libgv_sharp.la DEVTSTS += test_sharp endif +if WITH_GO +pkggo_DATA = $(GO_data) +man_MANS += gv.3go +pdf_DATA += gv.3go.pdf +pkggo_LTLIBRARIES = libgv_go.la +DEVTSTS += test_go +endif if WITH_GUILE pkgguile_DATA = $(GUILE_data) man_MANS += gv.3guile @@ -380,10 +398,10 @@ pkgIndex.tcl: libgv_tcl.la endif endif -man = gv.3sharp gv.3guile gv.3io gv.3java gv.3lua gv.3ocaml \ +man = gv.3sharp gv.3go gv.3guile gv.3io gv.3java gv.3lua gv.3ocaml \ gv.3perl gv.3php gv.3python gv.3r gv.3ruby gv.3tcl -pdf = gv.3sharp.pdf gv.3guile.pdf gv.3io.pdf gv.3java.pdf gv.3lua.pdf \ +pdf = gv.3sharp.pdf gv.3go.pdf gv.3guile.pdf gv.3io.pdf gv.3java.pdf gv.3lua.pdf \ gv.3ocaml.pdf gv.3perl.pdf gv.3php.pdf gv.3python.pdf gv.3r.pdf \ gv.3ruby.pdf gv.3tcl.pdf @@ -394,6 +412,9 @@ $(man): gv.i gv_doc_writer.tcl gv_doc_template.tcl gv_doc_langs.tcl gv.3sharp.pdf: gv.3sharp - $(GROFF) -Tps -man gv.3sharp | $(PS2PDF) - - >gv.3sharp.pdf +gv.3go.pdf: gv.3go + - $(GROFF) -Tps -man gv.3go | $(PS2PDF) - - >gv.3go.pdf + gv.3guile.pdf: gv.3guile - $(GROFF) -Tps -man gv.3guile | $(PS2PDF) - - >gv.3guile.pdf @@ -464,6 +485,7 @@ endif uninstall-hook: rm -rf $(DESTDIR)$(pkgsharpdir); + rm -rf $(DESTDIR)$(pkggodir); rm -rf $(DESTDIR)$(pkgguiledir); rm -rf $(DESTDIR)$(pkgiodir); rm -rf $(DESTDIR)$(pkgjavadir); @@ -490,6 +512,14 @@ test_sharp: libgv_sharp.la $(SHARP) *.cs -out:test.exe; \ mono test.exe) +.PHONY: test_go +test_go: libgv_go.la + -(mkdir -p test_go; cd test_go; \ + ln -fs ../.libs/libgv_go.so libgv.so; \ + ln -fs ../$(srcdir)/*.dot ../$(srcdir)/*.go .; \ + $(GO) *.go + LD_LIBRARY_PATH=. go test) + .PHONY: test_guile test_guile: libgv_guile.la -(mkdir -p test_guile; cd test_guile; \ @@ -574,6 +604,7 @@ EXTRA_DIST = $(man) $(pdf) gv_doc_*.tcl CLEANFILES = test_*/* pkgIndex.tcl \ gv_sharp.cpp $(SHARP_data) \ + gv_go.cpp $(GO_data) \ gv_guile.cpp $(GUILE_data) \ gv_io.cpp $(IO_data) \ gv_java.cpp $(JAVA_data) \ diff --git a/tclpkg/gv/gv_doc_langs.tcl b/tclpkg/gv/gv_doc_langs.tcl index 8a6beac58..2aa68d3c0 100644 --- a/tclpkg/gv/gv_doc_langs.tcl +++ b/tclpkg/gv/gv_doc_langs.tcl @@ -21,6 +21,49 @@ array set LANGS { USAGE { } } + go { + TYPES { + {Agraph_t* g} graph_handle + {Agraph_t* sg} subgraph_handle + {Agnode_t* n} node_handle + {Agnode_t* t} tail_node_handle + {Agnode_t* h} head_node_handle + {Agedge_t* e} edge_handle + {Agsym_t* a} attr_handle + {char* gne} type + {char* name} name + {char* tname} tail_name + {char* hname} head_name + {char* attr} attr_name + {char* val} attr_value + {const char* filename} filename + {char* engine} engine + {char* string} string + {char** outdata} outdata + {char* format} format + {FILE* f} channel + {void** data} data_handle + Agraph_t* graph_handle + Agnode_t* node_handle + Agedge_t* edge_handle + Agsym_t* attribute_handle + char* string + {const char*} string + char** outdata + FILE* channel + bool bool + int int + void** data_handle + void {} + } + SYNTAX { + gv. ( {, } {);} + } + SYNOPSIS { + } + USAGE { + } + } guile { TYPES { {Agraph_t* g} graph_handle