From 1961efbf933f1e50a2b386c3668097b7a79be157 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Get the Unix module working. --- .hgignore | 1 + ocaml/Makefile | 11 ++++++++++- ocaml/Makefile-fedora-mingw.in | 2 +- ocaml/mingw32-ocaml.spec | 11 +++++++++-- ocaml/test2.ml | 8 ++++++++ 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 ocaml/test2.ml diff --git a/.hgignore b/.hgignore index eb851d3..0eeb933 100644 --- a/.hgignore +++ b/.hgignore @@ -73,6 +73,7 @@ nss/nss-pem-20080124.tar.bz2 ocaml/ocaml-3.11.0+beta1.tar.bz2 ocaml/NUL ocaml/test1 +ocaml/test2 ocaml/*.exe ocaml/*.cmi ocaml/*.cmx diff --git a/ocaml/Makefile b/ocaml/Makefile index 5f3da01..722f355 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,10 +1,19 @@ # -*- Makefile -*- # Test programs for testing out the cross-compiler. -all: test1 test1.exe +all: test1 test1.exe test2 test2.exe test1: test1.ml ocamlopt $< -o $@ +test2: test2.ml + ocamlopt unix.cmxa $< -o $@ + test1.exe: test1.ml i686-pc-mingw32-ocamlopt $< -o $@ + +test2.exe: test2.ml + i686-pc-mingw32-ocamlopt unix.cmxa $< -o $@ + +clean: + rm -f test1 test2 *.exe *.cmi *.cmx *.o diff --git a/ocaml/Makefile-fedora-mingw.in b/ocaml/Makefile-fedora-mingw.in index ec0690c..385a8fc 100644 --- a/ocaml/Makefile-fedora-mingw.in +++ b/ocaml/Makefile-fedora-mingw.in @@ -46,7 +46,7 @@ ASPP=i686-pc-mingw32-gcc -c ASPPPROFFLAGS=-DPROFILING PROFILING=prof DYNLINKOPTS=-ldl -OTHERLIBRARIES=win32unix str num dynlink bigarray systhreads win32graph +OTHERLIBRARIES=@otherlibraries@ DEBUGGER=ocamldebugger CC_PROFILE=-pg SYSTHREAD_SUPPORT=true diff --git a/ocaml/mingw32-ocaml.spec b/ocaml/mingw32-ocaml.spec index bf82e7b..5df8d0c 100644 --- a/ocaml/mingw32-ocaml.spec +++ b/ocaml/mingw32-ocaml.spec @@ -6,9 +6,11 @@ %define debug_package %{nil} +%define otherlibraries win32unix str num dynlink bigarray systhreads win32graph + Name: mingw32-ocaml Version: 3.11.0+beta1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Objective Caml MinGW cross-compiler and programming environment License: QPL and (LGPLv2+ with exceptions) @@ -101,6 +103,7 @@ sed \ -e 's,@bindir@,%{_bindir},g' \ -e 's,@libdir@,%{_libdir},g' \ -e 's,@target@,%{_mingw32_target},g' \ + -e 's,@otherlibraries@,%{otherlibraries},g' \ < %{SOURCE1000} > Makefile popd @@ -136,6 +139,7 @@ rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/threads +mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs # This is the equivalent of 'make install installopt', but # we only want to install the parts which are really necessary @@ -144,6 +148,9 @@ mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/threads %define makevars BINDIR=$RPM_BUILD_ROOT%{_bindir} LIBDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml make %{makevars} -C byterun install make %{makevars} -C stdlib install +for i in %{otherlibraries}; do + make %{makevars} -C otherlibs/$i install +done make %{makevars} installopt cp config/Makefile \ @@ -172,5 +179,5 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-3 +* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-4 - Initial RPM release. diff --git a/ocaml/test2.ml b/ocaml/test2.ml new file mode 100644 index 0000000..9810b16 --- /dev/null +++ b/ocaml/test2.ml @@ -0,0 +1,8 @@ +open Printf +open Unix + +let () = + printf "$HOME = %S\n%!" + (try Unix.getenv "HOME" with Not_found -> "(none)"); + printf "gettimeofday = %f\n%!" (Unix.gettimeofday ()) + -- 1.8.3.1