From aebb9927a3670e02a0c3e83933dfea3c7bf8dbbe Mon Sep 17 00:00:00 2001 From: John Ellson Date: Mon, 6 Jan 2020 10:01:29 -0500 Subject: [PATCH] adding D and JAVASCRIPT lang bindings - currently disabled --- configure.ac | 94 ++++++++++++++++++++++++++++++++++++++++++- tclpkg/gv/Makefile.am | 42 +++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 569d72503..aa027c5f7 100644 --- a/configure.ac +++ b/configure.ac @@ -632,6 +632,51 @@ else fi AM_CONDITIONAL(WITH_SHARP, [test "x$use_sharp" = "xYes"]) +dnl ----------------------------------- +dnl INCLUDES and LIBS for D (disabled by default - incomplete) + +AC_ARG_ENABLE(d, + [AS_HELP_STRING([--enable-d=no],[d language bindings])], + [], [enable_d=no]) + +if test "x$enable_d" != "xyes"; then + use_d="No (disabled by default - incomplete" +else + if test "x$use_swig" != "xYes"; then + use_d="No (swig not available)" + else + if test `$SWIG -help 2>&1 | $EGREP -c '\-d* *- Generate'` = 0 ; then + use_d="No (swig does not support -d option)" + else + AC_CHECK_PROG(D,gdc,ldc) + if test "x$D" = "x"; then + use_d="No (D compiler not available)" + else + D_INCLUDES= +# D_INSTALL_DIR="/usr/lib${LIBPOSTFIX}/d/modules" +# D_INSTALL_DATADIR="/usr/share/d" + D_LIBS= +# save_CPPFLAGS=$CPPFLAGS +# CPPFLAGS="$CPPFLAGS $D_INCLUDES" +# AC_CHECK_HEADER(d.h,,[ +# use_d="No (missing header)" +# D= +# ]) +# CPPFLAGS=$save_CPPFLAGS + if test "x$D" != "x"; then + use_d="Yes" +# AC_SUBST([D_INSTALL_DATADIR]) +# AC_SUBST([D_INSTALL_DIR]) + AC_SUBST([D_INCLUDES]) + AC_SUBST([D_LIBS]) + AC_SUBST([INTDSIZE]) + fi + fi + fi + fi +fi +AM_CONDITIONAL(WITH_D, [test "x$use_d" = "xYes"]) + dnl ----------------------------------- dnl INCLUDES and LIBS for GO @@ -747,7 +792,7 @@ fi AM_CONDITIONAL(WITH_GUILE, [test "x$use_guile" = "xYes"]) dnl ----------------------------------- -dnl INCLUDES and LIBS for IO (disbled until supported by swig) +dnl INCLUDES and LIBS for IO (disabled until supported by swig) AC_ARG_ENABLE(io, [AS_HELP_STRING([--enable-io=no],[io language bindings])], @@ -840,6 +885,51 @@ else fi AM_CONDITIONAL(WITH_JAVA, [test "x$use_java" = "xYes"]) +dnl ----------------------------------- +dnl INCLUDES and LIBS for JAVASCRIPT (disabled by default - incomplete) + +AC_ARG_ENABLE(javascript, + [AS_HELP_STRING([--enable-javascript=no],[d language bindings])], + [], [enable_javascript=no]) + +if test "x$enable_javascript" != "xyes"; then + use_javascript="No (disabled by default - incomplete" +else + if test "x$use_swig" != "xYes"; then + use_javascript="No (swig not available)" + else + if test `$SWIG -help 2>&1 | $EGREP -c '\-javascript* *- Generate'` = 0 ; then + use_javascript="No (swig does not support -javascript option)" + else + AC_CHECK_PROG(JAVASCRIPT,js,js) + if test "x$JAVASCRIPT" = "x"; then + use_javascript="No (JAVASCRIPT compiler not available)" + else + JAVASCRIPT_INCLUDES= +# JAVASCRIPT_INSTALL_DIR="/usr/lib${LIBPOSTFIX}/javascript/modules" +# JAVASCRIPT_INSTALL_DATADIR="/usr/share/javascript" + JAVASCRIPT_LIBS= +# save_CPPFLAGS=$CPPFLAGS +# CPPFLAGS="$CPPFLAGS $JAVASCRIPT_INCLUDES" +# AC_CHECK_HEADER(javascript.h,,[ +# use_javascript="No (missing header)" +# JAVASCRIPT= +# ]) +# CPPFLAGS=$save_CPPFLAGS + if test "x$D" != "x"; then + use_javascript="Yes" +# AC_SUBST([JAVASCRIPT_INSTALL_DATADIR]) +# AC_SUBST([JAVASCRIPT_INSTALL_DIR]) + AC_SUBST([JAVASCRIPT_INCLUDES]) + AC_SUBST([JAVASCRIPT_LIBS]) + AC_SUBST([INTJAVASCRIPTSIZE]) + fi + fi + fi + fi +fi +AM_CONDITIONAL(WITH_JAVASCRIPT, [test "x$use_javascript" = "xYes"]) + dnl ----------------------------------- dnl INCLUDES and LIBS for LUA @@ -3105,10 +3195,12 @@ echo " xlib: $use_xlib" echo "" echo "language extensions:" echo " gv_sharp: $use_sharp" +echo " gv_d: $use_d" echo " gv_go: $use_go" echo " gv_guile: $use_guile" echo " gv_io: $use_io" echo " gv_java: $use_java" +echo " gv_javascript: $use_javascript" echo " gv_lua: $use_lua" echo " gv_ocaml: $use_ocaml" echo " gv_perl: $use_perl" diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index 9c975a677..e0d037544 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -32,6 +32,20 @@ $(SHARP_data): gv_sharp.cpp gv_sharp.cpp: gv.i $(SWIG) -c++ -csharp -namespace gv -o gv_sharp.cpp $(srcdir)/gv.i +pkgddir = $(pkglibdir)/d +D_data = +nodist_libgv_d_la_SOURCES = gv_d.cpp $(D_data) +libgv_d_la_SOURCES = $(BASESOURCES) gv_dummy_init.c +libgv_d_la_LIBADD = $(BASELIBS) $(D_LIBS) +libgv_d_la_LDFLAGS = -module -avoid-version +libgv_d_la_CPPFLAGS = $(BASECPPFLAGS) $(D_INCLUDES) +# $(D_data): gv_d.cpp +gv_d.cpp: gv.i + $(SWIG) -c++ -d -o gv_d.cpp $(srcdir)/gv.i + mv $@ $@.orig + sed '/include/s/malloc\.h/cstdlib/' $@.orig > $@ + rm $@.orig + pkggodir = $(pkglibdir)/go GO_data = runtime.h gv.go nodist_libgv_go_la_SOURCES = gv_go.cpp runtime.h gv.go @@ -106,6 +120,20 @@ $(JAVA_data): gv_java.cpp gv_java.cpp: gv.i $(SWIG) -package org.graphviz -java -c++ -o gv_java.cpp $(srcdir)/gv.i +pkgjavascriptdir = $(pkglibdir)/javascript +JAVASCRIPT_data = +nodist_libgv_javascript_la_SOURCES = gv_javascript.cpp $(JAVASCRIPT_data) +libgv_javascript_la_SOURCES = $(BASESOURCES) gv_dummy_init.c +libgv_javascript_la_LIBADD = $(BASELIBS) $(JAVASCRIPT_LIBS) +libgv_javascript_la_LDFLAGS = -module -avoid-version +libgv_javascript_la_CPPFLAGS = $(BASECPPFLAGS) $(JAVASCRIPT_INCLUDES) +# $(D_data): gv_javascript.cpp +gv_javascript.cpp: gv.i + $(SWIG) -c++ -javascript -o gv_d.cpp $(srcdir)/gv.i + mv $@ $@.orig + sed '/include/s/malloc\.h/cstdlib/' $@.orig > $@ + rm $@.orig + pkgluadir = $(pkglibdir)/lua LUA_data = nodist_libgv_lua_la_SOURCES = gv_lua.cpp $(LUA_data) @@ -265,6 +293,13 @@ pdf_DATA += gv.3sharp.pdf pkgsharp_LTLIBRARIES = libgv_sharp.la DEVTSTS += test_sharp endif +if WITH_D +pkgd_DATA = $(D_data) +#man_MANS += gv.3d +#pdf_DATA += gv.3d.pdf +pkgd_LTLIBRARIES = libgv_d.la +#DEVTSTS += test_d +endif if WITH_GO pkggo_DATA = $(GO_data) man_MANS += gv.3go @@ -293,6 +328,13 @@ pdf_DATA += gv.3java.pdf pkgjava_LTLIBRARIES = libgv_java.la DEVTSTS += test_java endif +if WITH_JAVASCRIPT +pkgd_DATA = $(JAVASCRIPT_data) +#man_MANS += gv.3javascript +#pdf_DATA += gv.3javascript.pdf +pkgjavascript_LTLIBRARIES = libgv_javascript.la +#DEVTSTS += test_javascript +endif if WITH_LUA pkglua_DATA = $(LUA_data) man_MANS += gv.3lua -- 2.40.0