Chris_T avatar Chris_T committed 4c52277

Compilation fixes for OCaml 3.11.0 on win32.

Comments (0)

Files changed (3)

 installation (,
 download "make" and "lapack".
-Modify Makefile.conf to include the full path of the lapack libraries, e.g.:
+For OCaml <= 3.10.2, modify Makefile.conf to include the full path of
+the lapack libraries, e.g.:
   export LIBDIRS := c:/cygwin/lib
+For OCaml >= 3.11.0, the default configuration should work.
 Open a cygwin shell, go to the directory where you downloaded Lacaml
 and type "make".
 ifdef MINGW
   export MINGW
   WIN32   := 1
-  CFLAGS_WIN32 := -mno-cygwin
+  # We are compiling with cywin tools:
+  CFLAGS_WIN32 := -mno-cygwin -I /usr/include
   # The default value 'cc' makes 'ocamlc -cc "cc"' raises the error 'The
   # NTVDM CPU has encountered an illegal instruction'.
   CC := gcc
 ifdef WIN32
 ifndef STATIC
 ifdef MINGW
+# From OCaml 3.11.0, ocamlmklib is available on windows
+ifeq ($(strip $(OCAMLMLIB_EXISTS)),)
 			$(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \
-			-Wl,--whole-archive $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
+			$(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
 			 '$(OCAMLLIBPATH)/ocamlrun.a' \
+			-Wl,--whole-archive \
 			-Wl,--export-all-symbols \
-			-Wl,--no-whole-archive \
 			-Wl,--allow-multiple-definition \
+				-o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) \
+				$(CFRAMEWORKS:%=-framework %) \
 ifdef MSVC
 			link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \
 -include ../Makefile.conf
 SYSTEM=$(shell ocamlc -config 2>/dev/null|grep system|sed 's/system: //')
   OCAMLBLDFLAGS = -ccopt "-framework vecLib"
 ifeq ($(SYSTEM), mingw)
-  # exp10 does not exists under cywin-mingw
+  # exp10 does not exists under cygwin-mingw
   EXP10 = exp10.c
-  # Useless for now:
-  INSTALL_DLL = lacaml_stubs.dll
+  # For ocaml >= 3.11.0
+  INSTALL_DLL = dlllacaml_stubs.dll
   EXP10 =
 endif \
   io.cmi utils.cmi common.cmi \
   lacaml.cmi lacaml.cma lacaml_top.cma lacaml.cmxa lacaml.a \
-  liblacaml_stubs.a
+  liblacaml_stubs.a $(INSTALL_DLL)
 TRASH := \
   $(PREMAKE) \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.