X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=ocaml%2Fmingw32-ocaml.spec;h=174fa64c263b8dbaf90dd27b6ea360664ab4a51a;hb=45e6cd261eb9ae423b6ae8fe6aa3bf74bfa923a7;hp=10d47c19cf9b97ed3d05988c16aa5bc55b44b299;hpb=af49c8b9b5da16b36df91b6c00729d9ea2e9c729;p=fedora-mingw.git diff --git a/ocaml/mingw32-ocaml.spec b/ocaml/mingw32-ocaml.spec index 10d47c1..174fa64 100644 --- a/ocaml/mingw32-ocaml.spec +++ b/ocaml/mingw32-ocaml.spec @@ -1,5 +1,7 @@ -%define __strip %{_mingw32_strip} -%define __objdump %{_mingw32_objdump} +#%define __strip %{_mingw32_strip} +#%define __objdump %{_mingw32_objdump} +%define __strip : +%define __objdump : %define _use_internal_dependency_generator 0 %define __find_requires %{_mingw32_findrequires} %define __find_provides %{_mingw32_findprovides} @@ -10,7 +12,7 @@ Name: mingw32-ocaml Version: 3.11.0+beta1 -Release: 5%{?dist} +Release: 10%{?dist} Summary: Objective Caml MinGW cross-compiler and programming environment License: QPL and (LGPLv2+ with exceptions) @@ -43,6 +45,11 @@ BuildRequires: mingw32-gcc BuildRequires: mingw32-binutils BuildRequires: mingw32-flexdll +# These are required so we can use gcc -m32 and link to 32 bit X11: +BuildRequires: /lib/libgcc_s.so.1 +BuildRequires: /usr/lib/crt1.o +BuildRequires: /usr/lib/libX11.so + # While we still ship bytecode, this requires a /usr/bin/ocamlrun from # the _identical_ native package. We don't have that at the moment, # which is why this is commented out. @@ -54,6 +61,10 @@ Requires: mingw32-gcc Requires: mingw32-binutils Requires: mingw32-flexdll +# i686-pc-mingw32-ocamlmklib tries to run ocamlopt which is probably a +# bug, but requires this (XXX). +Requires: ocaml + %description Objective Caml is a high-level, strongly-typed, functional and @@ -76,13 +87,22 @@ and produces Windows native executables. %build -# Build native ocamlrun and ocamlc which contain the filename-win32-dirsep -# patch. +# Don't run out of memory. +ulimit -s unlimited + +# Build native ocamlrun and ocamlc which contain the +# filename-win32-dirsep patch. +# +# Note that we must build a 32 bit compiler, even on 64 bit build +# architectures, because this compiler will try to do strength +# reduction optimizations using its internal int type, and that must +# match Windows' int type. (That's what -cc and -host are for). ./configure \ -no-tk \ -bindir %{_bindir} \ -libdir %{_libdir}/ocaml \ - -mandir %{_mandir}/man1 + -mandir %{_mandir}/man1 \ + -cc "gcc -m32" -host i386-pc-linux -x11lib /usr/lib -verbose make world # Now move the working ocamlrun, ocamlc into the boot/ directory, @@ -157,20 +177,32 @@ make %{makevars} -C stdlib install for i in %{otherlibraries}; do make %{makevars} -C otherlibs/$i install done +make %{makevars} -C tools install make %{makevars} installopt +install -m 0755 ocamlc $RPM_BUILD_ROOT%{_bindir} + cp config/Makefile \ $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/Makefile.config -# Rename the binaries so they don't clash with base OCaml package. -mv $RPM_BUILD_ROOT%{_bindir}/ocamlrun \ - $RPM_BUILD_ROOT%{_bindir}/%{_mingw32_target}-ocamlrun -echo '#!%{_bindir}/%{_mingw32_target}-ocamlrun' \ - > $RPM_BUILD_ROOT%{_bindir}/%{_mingw32_target}-ocamlopt -tail -n +2 $RPM_BUILD_ROOT%{_bindir}/ocamlopt \ - >> $RPM_BUILD_ROOT%{_bindir}/%{_mingw32_target}-ocamlopt -chmod 0755 $RPM_BUILD_ROOT%{_bindir}/%{_mingw32_target}-ocamlopt -rm $RPM_BUILD_ROOT%{_bindir}/ocamlopt +# For bytecode binaries, change the bang-path to point to the locally +# installed ocamlrun. +pushd $RPM_BUILD_ROOT%{_bindir} +for f in ocamlc ocamlcp ocamldep ocamlmklib ocamlopt ocamlprof; do + mv $f $f.old + echo '#!%{_bindir}/%{_mingw32_target}-ocamlrun' > $f + tail -n +2 $f.old >> $f + chmod +x $f + rm $f.old +done +popd + +# Rename all the binaries to target-binary. +pushd $RPM_BUILD_ROOT%{_bindir} +for f in ocamlc ocamlcp ocamldep ocamlmklib ocamlmktop ocamlopt ocamlprof ocamlrun; do + mv $f %{_mingw32_target}-$f +done +popd %clean @@ -179,12 +211,34 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%{_bindir}/%{_mingw32_target}-ocamlrun +%{_bindir}/%{_mingw32_target}-ocamlc +%{_bindir}/%{_mingw32_target}-ocamlcp +%{_bindir}/%{_mingw32_target}-ocamldep +%{_bindir}/%{_mingw32_target}-ocamlmklib +%{_bindir}/%{_mingw32_target}-ocamlmktop +%{_bindir}/%{_mingw32_target}-ocamlprof %{_bindir}/%{_mingw32_target}-ocamlopt +%{_bindir}/%{_mingw32_target}-ocamlrun %{_libdir}/%{_mingw32_target}-ocaml/ %changelog +* Sun Nov 16 2008 Richard W.M. Jones - 3.11.0+beta1-10 +- Build the native compiler as 32 bits even on a 64 bit build + architecture (because the target, Windows, is 32 bit). The + compiler does strength reduction and other optimizations + internally so we must ensure it uses the same int type. +- Requires libX11-devel.i386 and libgcc.i386. + +* Sun Nov 16 2008 Richard W.M. Jones - 3.11.0+beta1-8 +- Install ocamlc. + +* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-7 +- Further requirements. + +* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-6 +- Install tools, particularly ocamlmklib. + * Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-5 - +Requires mingw32-flexdll and the cross-compiler.