[Libguestfs] [PATCH 1/2] golang: Fix for out-of-tree builds
Richard W.M. Jones
rjones at redhat.com
Fri Dec 13 08:32:47 UTC 2013
On Fri, Dec 13, 2013 at 12:00:12AM +0100, Hilko Bengen wrote:
> ---
> configure.ac | 2 +-
> golang/Makefile.am | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 4e2bc65..9abec95 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1530,7 +1530,7 @@ AS_IF([test "x$enable_golang" != "xno"],[
> AC_CHECK_PROG([GOLANG],[go],[go],[no])
> AS_IF([test "x$GOLANG" != "xno"],[
> AC_MSG_CHECKING([if $GOLANG is usable])
> - AS_IF([$GOLANG run golang/config-test.go 2>&AS_MESSAGE_LOG_FD],[
> + AS_IF([$GOLANG run $srcdir/golang/config-test.go 2>&AS_MESSAGE_LOG_FD],[
> AC_MSG_RESULT([yes])
>
> # Substitute some golang environment.
ACK ^^^ to the above part.
I think the vvv below part is a hack and we shouldn't put it upstream.
I appreciate how complicated Go packaging is, as it defies proper
distro packaging, but I still don't want to take this.
> diff --git a/golang/Makefile.am b/golang/Makefile.am
> index a7dd1b2..a60c9ba 100644
> --- a/golang/Makefile.am
> +++ b/golang/Makefile.am
> @@ -44,6 +44,7 @@ golangpkg_DATA = \
> pkg/$(GOOS)_$(GOARCH)/$(pkg).a
>
> pkg/$(GOOS)_$(GOARCH)/$(pkg).a: src/$(pkg)/guestfs.go
> + -[ $(srcdir) != $(builddir) ] && cp -rsu $(abs_srcdir)/src $(builddir)/src
> $(top_builddir)/run $(GOLANG) install $(pkg)
>
> golangsrc_DATA = $(source_files)
> @@ -57,4 +58,5 @@ endif
> CLEANFILES = *~ src/$(pkg)/*~
>
> clean-local:
> + -[ $(srcdir) != $(builddir) ] && rm -rf $(builddir)/src
> rm -rf pkg
> --
> 1.8.5.1
>
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
More information about the Libguestfs
mailing list