Add upstream patch to fix OCaml bytecode compilation.

This commit is contained in:
Richard W.M. Jones 2012-01-28 17:41:54 +00:00
parent 204356a85a
commit 33c8a61346
2 changed files with 112 additions and 2 deletions

View File

@ -0,0 +1,104 @@
From 03684e7a616eab56a81665c8c8859426e50ae429 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 28 Jan 2012 17:35:34 +0000
Subject: [PATCH] ocaml: Various fixes for bytecode compilation.
Set LD_LIBRARY_PATH so we link against the just-built library, not
the installed library.
Use OCAMLCFLAGS instead of OCAMLOPTFLAGS where appropriate.
Remove unnecessary -cclib option for bytecode linking (gcc is not used
in this case).
This fixes commit eb68a314133c88260cdf4547d7d338446488e698.
---
ocaml/Makefile.am | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 50f2649..c512d0b 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -102,7 +102,8 @@ noinst_DATA += \
bindtests.bc: bindtests.cmo mlguestfs.cma
mkdir -p t
- $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
bindtests.opt: bindtests.cmx mlguestfs.cmxa
mkdir -p t
@@ -110,7 +111,8 @@ bindtests.opt: bindtests.cmx mlguestfs.cmxa
t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma
mkdir -p t
- $(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
mkdir -p t
@@ -118,7 +120,8 @@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma
mkdir -p t
- $(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
mkdir -p t
@@ -126,7 +129,8 @@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma
mkdir -p t
- $(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@
+ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@
t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
mkdir -p t
@@ -134,7 +138,8 @@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma
mkdir -p t
- $(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
mkdir -p t
@@ -142,7 +147,8 @@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma
mkdir -p t
- $(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
mkdir -p t
@@ -150,7 +156,8 @@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma
mkdir -p t
- $(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
mkdir -p t
@@ -159,7 +166,7 @@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
# Need to rebuild the tests from source if the main library has
# changed at all, otherwise we get inconsistent assumptions.
t/guestfs_070_threads.cmo: t/guestfs_070_threads.ml mlguestfs.cma
- $(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -package unix,threads -thread -linkpkg -c $< -o $@
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix,threads -thread -linkpkg -c $< -o $@
t/guestfs_070_threads.cmx: t/guestfs_070_threads.ml mlguestfs.cmxa
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix,threads -thread -linkpkg -c $< -o $@
--
1.7.6

View File

@ -30,7 +30,7 @@ Summary: Access and modify virtual machine disk images
Name: libguestfs
Epoch: 1
Version: 1.17.3
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: Development/Libraries
URL: http://libguestfs.org/
@ -41,6 +41,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
ExclusiveArch: x86_64
%endif
# Upstream patch to fix OCaml bytecode compilation.
Patch0001: 0001-ocaml-Various-fixes-for-bytecode-compilation.patch
# Basic build requirements:
BuildRequires: /usr/bin/pod2man
BuildRequires: /usr/bin/pod2text
@ -623,6 +626,8 @@ for %{name}.
%prep
%setup -q
%patch0001 -p1
mkdir -p daemon/m4
# Replace developer-specific README that ships with libguestfs, with
@ -1021,9 +1026,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Sat Jan 28 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.17.3-1
* Sat Jan 28 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.17.3-2
- New upstream version 1.17.3.
- Remove patch now upstream.
- Add upstream patch to fix OCaml bytecode compilation.
* Fri Jan 27 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.17.2-3
- Upstream patch to work with udev >= 176.