| Additional Information | Hi, I know MinGW/msys is not really supported but nonetheless I gave the new MinGW environment a try (gcc-4.5.0, binutils 2.20.51.20100613).
To compile the attached patch was needed to add "L/mingw/lib" at various places, it produced working ocamlc and ocamlopt.opt
$ ocamlopt.opt -v
The Objective Caml native-code compiler, version 3.12.0
Standard library directory: c:/GNU/ocaml3120/lib
$ ocamlc -v
The Objective Caml compiler, version 3.12.0
Standard library directory: c:/GNU/ocaml3120/lib
Can you give me a hint please what to do with camlp4? I already tried this without success:
--- ocaml-3.12.0.org//myocamlbuild.ml 2010-06-08 11:50:56.000000000 +0200
+++ ocaml-3.12.0/myocamlbuild.ml 2010-09-18 19:52:48.000000000 +0200
@@ -744,7 +744,7 @@
begin fun _ _ ->
Cmd(S[ocamlc; A"-I"; P dynlink_dir; A "dynlink.cma"; include_unix; unix_cma;
T(tags_of_pathname byte++"ocaml"++"link"++"byte");
- P camlp4lib_cma; A"-linkall"; atomize cmos; A"-o"; Px (add_exe byte)])
+ P camlp4lib_cma; A"-cclib"; A"-L/mingw/lib"; A"-cclib"; A"-lws2_32"; A"-linkall"; atomize cmos; A"-o"; Px (add_exe byte)])
end;
rule native
~deps:(camlp4lib_cmxa :: camlp4lib_lib :: (cmxs @ objs @ dep_unix_native @ dep_dynlink_native))
|
| Attached Files | ocaml3120_mingw.diff [^] (4,459 bytes) 2010-09-18 21:25 [Show Content] [Hide Content]diff -uNr ocaml-3.12.0.org//build/ocamlbuild-native-only.sh ocaml-3.12.0/build/ocamlbuild-native-only.sh
--- ocaml-3.12.0.org//build/ocamlbuild-native-only.sh 2010-05-20 11:44:25.000000000 +0200
+++ ocaml-3.12.0/build/ocamlbuild-native-only.sh 2010-09-18 12:05:32.000000000 +0200
@@ -19,4 +19,4 @@
cd `dirname $0`/..
. build/targets.sh
set -x
-$OCAMLBUILD $@ native_stdlib_mixed_mode $OCAMLOPT_BYTE $OCAMLLEX_BYTE $OCAMLBUILD_NATIVE
+$OCAMLBUILD $@ native_stdlib_mixed_mode $OCAMLOPT_BYTE $OCAMLLEX_BYTE $OCAMLBUILD_NATIVE -lflag -cclib -lflag -L/mingw/lib
diff -uNr ocaml-3.12.0.org//config/Makefile.mingw ocaml-3.12.0/config/Makefile.mingw
--- ocaml-3.12.0.org//config/Makefile.mingw 2010-05-25 12:00:39.000000000 +0200
+++ ocaml-3.12.0/config/Makefile.mingw 2010-09-18 12:03:42.000000000 +0200
@@ -72,6 +72,7 @@
EXTRALIBS=
NATDYNLINK=true
CMXS=cmxs
+LDOPTS=-L/mingw/lib
########## Configuration for the bytecode compiler
@@ -95,7 +96,7 @@
CPP=$(BYTECC) -E
### Flexlink
-FLEXLINK=flexlink -chain mingw
+FLEXLINK=flexlink -chain mingw -L/mingw/lib
FLEXDIR=$(shell $(FLEXLINK) -where)
IFLEXDIR=-I"$(FLEXDIR)"
MKDLL=$(FLEXLINK)
diff -uNr ocaml-3.12.0.org//driver/ocamlcomp.sh.in ocaml-3.12.0/driver/ocamlcomp.sh.in
--- ocaml-3.12.0.org//driver/ocamlcomp.sh.in 2010-05-20 11:44:25.000000000 +0200
+++ ocaml-3.12.0/driver/ocamlcomp.sh.in 2010-09-18 13:26:49.000000000 +0200
@@ -2,4 +2,4 @@
topdir=`dirname $0`
-exec @compiler@ -nostdlib -I $topdir/stdlib "$@"
+exec @compiler@ -nostdlib -I $topdir/stdlib -cclib -L/mingw/lib "$@"
diff -uNr ocaml-3.12.0.org//lex/Makefile.nt ocaml-3.12.0/lex/Makefile.nt
--- ocaml-3.12.0.org//lex/Makefile.nt 2010-01-20 17:26:46.000000000 +0100
+++ ocaml-3.12.0/lex/Makefile.nt 2010-09-18 12:04:47.000000000 +0200
@@ -17,7 +17,7 @@
include ../config/Makefile
CAMLC=../boot/ocamlrun ../boot/ocamlc -I ../boot
-CAMLOPT=../boot/ocamlrun ../ocamlopt -I ../stdlib
+CAMLOPT=../boot/ocamlrun ../ocamlopt -I ../stdlib -cclib $(LDOPTS)
COMPFLAGS=-warn-error A
LINKFLAGS=
CAMLYACC=../boot/ocamlyacc
diff -uNr ocaml-3.12.0.org//Makefile.nt ocaml-3.12.0/Makefile.nt
--- ocaml-3.12.0.org//Makefile.nt 2010-07-06 12:02:53.000000000 +0200
+++ ocaml-3.12.0/Makefile.nt 2010-09-18 12:03:14.000000000 +0200
@@ -20,7 +20,7 @@
CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
COMPFLAGS=-strict-sequence -warn-error A $(INCLUDES)
-LINKFLAGS=
+LINKFLAGS=-cclib $(LDOPTS)
CAMLYACC=boot/ocamlyacc
YACCFLAGS=
CAMLLEX=boot/ocamlrun boot/ocamllex
diff -uNr ocaml-3.12.0.org//otherlibs/Makefile.nt ocaml-3.12.0/otherlibs/Makefile.nt
--- ocaml-3.12.0.org//otherlibs/Makefile.nt 2010-01-22 13:48:24.000000000 +0100
+++ ocaml-3.12.0/otherlibs/Makefile.nt 2010-09-18 12:04:02.000000000 +0200
@@ -16,7 +16,7 @@
# Common Makefile for otherlibs on the Win32/MinGW ports
CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib -w s
-CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib -w s
+CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -cclib -L/mingw/lib -I $(ROOTDIR)/stdlib -w s
CFLAGS=-I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
include ../Makefile.shared
diff -uNr ocaml-3.12.0.org//otherlibs/systhreads/Makefile.nt ocaml-3.12.0/otherlibs/systhreads/Makefile.nt
--- ocaml-3.12.0.org//otherlibs/systhreads/Makefile.nt 2010-04-27 09:55:08.000000000 +0200
+++ ocaml-3.12.0/otherlibs/systhreads/Makefile.nt 2010-09-18 12:04:25.000000000 +0200
@@ -17,7 +17,7 @@
# Compilation options
CAMLC=../../boot/ocamlrun ../../ocamlc -I ../../stdlib -I ../win32unix
-CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../win32unix
+CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../win32unix -cclib -L/mingw/lib
COMPFLAGS=-warn-error A -g
MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
CFLAGS=-I../../byterun $(EXTRACFLAGS)
diff -uNr ocaml-3.12.0.org//tools/Makefile.shared ocaml-3.12.0/tools/Makefile.shared
--- ocaml-3.12.0.org//tools/Makefile.shared 2010-06-07 08:58:41.000000000 +0200
+++ ocaml-3.12.0/tools/Makefile.shared 2010-09-18 12:05:04.000000000 +0200
@@ -21,7 +21,7 @@
INCLUDES=-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp \
-I ../driver
COMPFLAGS= -warn-error A $(INCLUDES)
-LINKFLAGS=$(INCLUDES)
+LINKFLAGS=$(INCLUDES) -cclib $(LDOPTS)
all: ocamldep ocamlprof ocamlcp ocamlmktop ocamlmklib dumpobj objinfo
# scrapelabels addlabels
|