]> granicus.if.org Git - graphviz/commitdiff
not yet complete changes for "go" language support
authorellson <devnull@localhost>
Wed, 9 Feb 2011 19:04:40 +0000 (19:04 +0000)
committerellson <devnull@localhost>
Wed, 9 Feb 2011 19:04:40 +0000 (19:04 +0000)
configure.ac
tclpkg/Makefile.am
tclpkg/gv/Makefile.am
tclpkg/gv/gv_doc_langs.tcl

index e1b492e6d50274cd4acf51908cc62c886f2c74b6..d15c37ead0f0e34a1f193e43d40f3b25f0558058 100644 (file)
@@ -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"
index a8c5a180de4fd36196c977bfb26fe3d53b9e378e..4796b632f158849e6c66148a3a638c1a38e3bee6 100644 (file)
@@ -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);
index ead6df14143d13853c9efb920ae68c89c80b68f6..bcc3d264b0b3cf6bd8ebb305e0c538d18b7b9859 100644 (file)
@@ -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) \
index 8a6beac5841444f29ddead78013703ca57e8cf47..2aa68d3c09e662b47de2eba8a85945ca450c0059 100644 (file)
@@ -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