From b5a3b9d421bee7f74ccaf86b100fc192cd766ff7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 20 Jul 2015 15:33:02 +0100 Subject: [PATCH] Enable bytecode compilation. --- camlidl-1.05-bytecode.patch | 109 ++++++++++++++++++++++++++++++++++++ ocaml-camlidl.spec | 17 +++++- 2 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 camlidl-1.05-bytecode.patch diff --git a/camlidl-1.05-bytecode.patch b/camlidl-1.05-bytecode.patch new file mode 100644 index 0000000..58eca1b --- /dev/null +++ b/camlidl-1.05-bytecode.patch @@ -0,0 +1,109 @@ +diff -ur camlidl-1.05.old/compiler/Makefile camlidl-1.05.byte/compiler/Makefile +--- camlidl-1.05.old/compiler/Makefile 2015-07-20 15:16:31.848993427 +0100 ++++ camlidl-1.05.byte/compiler/Makefile 2015-07-20 15:22:59.352428185 +0100 +@@ -32,6 +32,9 @@ + $(PROG): $(XOBJS) + $(OCAMLOPT) -o $(PROG) $(XOBJS) + ++byte: $(OBJS) ++ $(OCAMLC) -o $(PROG) $(OBJS) ++ + clean:: + rm -f $(PROG) + +@@ -85,6 +88,8 @@ + install: + cp $(PROG) $(BINDIR) + ++install-byte: install ++ + # Clean up + clean:: + rm -f *.cm[iox] *~ +diff -ur camlidl-1.05.old/lib/Makefile camlidl-1.05.byte/lib/Makefile +--- camlidl-1.05.old/lib/Makefile 2002-04-22 12:50:47.000000000 +0100 ++++ camlidl-1.05.byte/lib/Makefile 2015-07-20 15:32:15.716052397 +0100 +@@ -22,6 +22,8 @@ + + all: $(BYTELIB) $(NATIVELIB) + ++byte: $(BYTELIB) ++ + $(BYTELIB): $(BYTEOBJS) + $(OCAMLC) -a -o $(BYTELIB) $(BYTEOBJS) + +@@ -32,6 +34,9 @@ + cp $(INTERFACES) $(BYTELIB) $(NATIVELIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) $(OCAMLLIB) + cd $(OCAMLLIB); $(RANLIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) + ++install-byte: ++ cp $(INTERFACES) $(BYTELIB) $(OCAMLLIB) ++ + .SUFFIXES: .mli .ml .cmi .cmo .cmx + + .mli.cmi: +diff -ur camlidl-1.05.old/Makefile camlidl-1.05.byte/Makefile +--- camlidl-1.05.old/Makefile 2000-08-19 12:04:55.000000000 +0100 ++++ camlidl-1.05.byte/Makefile 2015-07-20 15:24:37.154537915 +0100 +@@ -20,12 +20,24 @@ + cd lib; $(MAKE) all + cd tools; $(MAKE) all + ++byte: ++ cd compiler; $(MAKE) byte ++ cd runtime; $(MAKE) byte ++ cd lib; $(MAKE) byte ++ cd tools; $(MAKE) byte ++ + install: + cd compiler; $(MAKE) install + cd runtime; $(MAKE) install + cd lib; $(MAKE) install + cd tools; $(MAKE) install + ++install-byte: ++ cd compiler; $(MAKE) install-byte ++ cd runtime; $(MAKE) install-byte ++ cd lib; $(MAKE) install-byte ++ cd tools; $(MAKE) install-byte ++ + clean: + cd compiler; $(MAKE) clean + cd runtime; $(MAKE) clean +diff -ur camlidl-1.05.old/runtime/Makefile.unix camlidl-1.05.byte/runtime/Makefile.unix +--- camlidl-1.05.old/runtime/Makefile.unix 2000-08-19 12:05:00.000000000 +0100 ++++ camlidl-1.05.byte/runtime/Makefile.unix 2015-07-20 15:26:23.065656741 +0100 +@@ -16,6 +16,8 @@ + + all: libcamlidl.a + ++byte: all ++ + libcamlidl.a: $(OBJS) + - rm -f $@ + ar rc $@ $(OBJS) +@@ -26,6 +28,8 @@ + cp libcamlidl.a $(OCAMLLIB)/libcamlidl.a + cd $(OCAMLLIB); $(RANLIB) libcamlidl.a + ++install-byte: install ++ + clean: + rm -f *.a *.o + +diff -ur camlidl-1.05.old/tools/Makefile.unix camlidl-1.05.byte/tools/Makefile.unix +--- camlidl-1.05.old/tools/Makefile.unix 2000-08-19 12:05:00.000000000 +0100 ++++ camlidl-1.05.byte/tools/Makefile.unix 2015-07-20 15:26:01.051632043 +0100 +@@ -14,8 +14,12 @@ + + all: + ++byte: ++ + install: + ++install-byte: ++ + clean: + + depend: diff --git a/ocaml-camlidl.spec b/ocaml-camlidl.spec index bdc7a8d..90b7dec 100644 --- a/ocaml-camlidl.spec +++ b/ocaml-camlidl.spec @@ -2,7 +2,7 @@ Name: ocaml-camlidl Version: 1.05 -Release: 31%{?dist} +Release: 32%{?dist} Summary: Stub code generator and COM binding for Objective Caml License: QPL and LGPLv2 with exceptions @@ -15,7 +15,8 @@ Source2: META.camlidl.in # Build the compiler into a native code program using ocamlopt. Patch1: camlidl-1.05-use-ocamlopt-for-compiler.patch -ExcludeArch: sparc64 s390 s390x +# Add 'make byte' and 'make install-byte' targets. +Patch2: camlidl-1.05-bytecode.patch BuildRequires: ocaml BuildRequires: ocaml-ocamldoc @@ -52,6 +53,7 @@ developing applications that use %{name}. %setup -q -n camlidl-%{version} %patch1 -p1 +%patch2 -p1 sed -e 's|^OCAMLLIB=.*|OCAMLLIB=%{_libdir}/ocaml|' \ -e 's|^BINDIR=.*|BINDIR=%{_bindir}|' \ @@ -79,7 +81,11 @@ cp %{SOURCE1} . %build +%if %opt make all +%else +make byte +%endif %install @@ -93,7 +99,11 @@ sed 's/@VERSION@/%{version}/' < %{SOURCE2} > $RPM_BUILD_ROOT/%{_libdir}/ocaml/ME make OCAMLLIB=$RPM_BUILD_ROOT/%{_libdir}/ocaml \ BINDIR=$RPM_BUILD_ROOT/%{_bindir} \ +%if %opt install +%else + install-byte +%endif %files @@ -116,6 +126,9 @@ make OCAMLLIB=$RPM_BUILD_ROOT/%{_libdir}/ocaml \ %changelog +* Mon Jul 20 2015 Richard W.M. Jones - 1.05-32 +- Enable bytecode compilation. + * Wed Jun 24 2015 Richard W.M. Jones - 1.05-31 - ocaml-4.02.2 final rebuild.