Commit 273c4632 authored by John Ellson's avatar John Ellson

enable go rpms, experimentally

parent bdc809ad
......@@ -102,13 +102,16 @@ AC_SUBST([GRAPHVIZ_VERSION_BUILD])
AC_SUBST([GRAPHVIZ_VERSION_REVISION])
AC_ARG_VAR(LIBPOSTFIX, [subscript to lib, e.g. "/64" for "/usr/lib/64" on Solaris])
AC_ARG_VAR(INTGOSIZE, [integer size for go, 32 or 64])
INTGOSIZE=32
if test -z "$LIBPOSTFIX"; then
case "${host_os}" in
*linux* )
case "${host_cpu}" in
aarch64 | powerpc64 | powerpc64le | s390x | x86_64 | sparc64 )
LIBPOSTFIX="64"
INTGOSIZE=64
;;
esac
;;
......@@ -116,6 +119,7 @@ if test -z "$LIBPOSTFIX"; then
case "${host_cpu}" in
x86_64 | sparc64 )
LIBPOSTFIX="/64"
INTGOSIZE=64
;;
esac
;;
......@@ -674,6 +678,7 @@ else
# AC_SUBST([GO_INSTALL_DIR])
AC_SUBST([GO_INCLUDES])
AC_SUBST([GO_LIBS])
AC_SUBST([INTGOSIZE])
fi
fi
fi
......
......@@ -164,7 +164,7 @@ BuildRequires: libwebp-devel
%if %fedora >= 19
%define SEPARATE_LICENSE 1
%endif
%if %fedora >= 23
%if %fedora >= 20
%define _GO 1
BuildRequires: golang >= 1.2 gcc-go
%endif
......
......@@ -39,29 +39,27 @@ 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)
gv_gc.c gv.go: gv_go.cpp
gv_go.cpp: gv.i
$(SWIG) -c++ -go -o gv_go.cpp $(srcdir)/gv.i
$(SWIG) -c++ -go -intgosize $(INTGOSIZE) -o gv_go.cpp $(srcdir)/gv.i
mv $@ $@.orig
sed '/include/s/malloc\.h/cstdlib/' $@.orig > $@
rm $@.orig
#gvgotest: gv.i gvgotest.go
# ( \
# mkdir -p go/src/gv; \
# $(SED) -e 's/#include "gvc.h"/#include <graphviz\/gvc.h>/' <$(srcdir)/gv.i >go/src/gv/gv.swigcxx; \
# $(SED) -e 's/#include <gvc.h>/#include <graphviz\/gvc.h>/' <$(srcdir)/gv_dummy_init.c >go/src/gv/gv_dummy_init.c; \
# $(SED) -e 's/#include "gvplugin.h"/#include <graphviz\/gvplugin.h>/' <$(srcdir)/gv_builtins.c >go/src/gv/gv_builtins.c; \
# $(SED) -e 's/#include "gvc.h"/#include <graphviz\/gvc.h>/' -e 's/DEMAND_LOADING/1/' <$(srcdir)/gv.cpp >go/src/gv/gv.cpp; \
# echo "package gv" >go/src/gv/gv.go; \
# cat $(srcdir)/gvgotest.go >go/src/gvgotest.go; \
# cd go/src; \
# GOROOT=/home/ellson/FIX/Linux.x86_64/build/go \
# GOPATH=/home/ellson/FIX/Linux.x86_64/build/graphviz/tclpkg/gv/go \
# /home/ellson/FIX/Linux.x86_64/build/go/bin/go build -x -work -gccgoflags -lgvc -compiler gccgo gvgotest.go && mv gvgotest ../../; \
# )
gvgotest: gv.i gvgotest.go
( \
mkdir -p go/src/gv; \
$(SED) -e 's/#include "gvc.h"/#include <graphviz\/gvc.h>/' <$(srcdir)/gv.i >go/src/gv/gv.swigcxx; \
$(SED) -e 's/#include <gvc.h>/#include <graphviz\/gvc.h>/' <$(srcdir)/gv_dummy_init.c >go/src/gv/gv_dummy_init.c; \
$(SED) -e 's/#include "gvplugin.h"/#include <graphviz\/gvplugin.h>/' <$(srcdir)/gv_builtins.c >go/src/gv/gv_builtins.c; \
$(SED) -e 's/#include "gvc.h"/#include <graphviz\/gvc.h>/' -e 's/DEMAND_LOADING/1/' <$(srcdir)/gv.cpp >go/src/gv/gv.cpp; \
echo "package gv" >go/src/gv/gv.go; \
cat $(srcdir)/gvgotest.go >go/src/gvgotest.go; \
cat $(srcdir)/gv_gc.c >go/src/gv_gc.c; \
cd go/src; \
GOPATH=/home/ellson/FIX/Linux.x86_64/build/graphviz/tclpkg/gv/go \
$(GO) build -x -work -gccgoflags -lgvc -compiler gccgo gvgotest.go && mv gvgotest ../../; \
)
pkgguiledir = $(pkglibdir)/guile
GUILE_data =
......@@ -292,11 +290,11 @@ 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
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment