caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: "matthieu.dubuget@gmail.com" <matthieu.dubuget@gmail.com>,
	Caml Mailing List <caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] Trying to setup mingw OCaml 3.12.1 + fresh cygwin
Date: Wed, 10 Aug 2011 08:25:02 +0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9C23E6979@Remus.metastack.local> (raw)
In-Reply-To: <4E3FF432.3000705@gmail.com>

Matthieu Dubuget wrote:
> Hello,
> 
> I'm trying to setup a system to test it on my code base.
> 
> Currently, I have installed
> - cygwin + mingw64-i686-gcc-core
> - a patched flexdll (basically: makes use of i686-w64-mingw32-gcc instead
> of gcc -mno-cygwin)
> - compiled and installed ocaml
> > $ ocamlc -config
> > version: 3.12.1
> > standard_library_default: C:/cygwin/home/matt/ocamlmgw/lib
> > standard_library: C:/cygwin/home/matt/ocamlmgw/lib
> > standard_runtime: ocamlrun
> > ccomp_type: cc
> > bytecomp_c_compiler: i686-w64-mingw32-gcc -O -mms-bitfields -Wall
> > -Wno-unused
> > bytecomp_c_libraries: -lws2_32
> > native_c_compiler: i686-w64-mingw32-gcc -O -mms-bitfields -Wall
> > -Wno-unused
> > native_c_libraries: -lws2_32
> > native_pack_linker: i686-w64-mingw32-ld -r -o
> > ranlib: i686-w64-mingw32-ranlib
> > cc_profile:
> > architecture: i386
> > model: default
> > system: mingw
> > asm: i686-w64-mingw32-as
> > ext_obj: .o
> > ext_asm: .s
> > ext_lib: .a
> > ext_dll: .dll
> > os_type: Win32
> > default_executable_name: camlprog.exe
> > systhread_supported: true

Good to know that 64-bit MinGW is working - that said, I thought the MinGW port was broken in 3.12.1 or is that not affected with the 64-bit compiler? Could you share details on how you configured OCaml?

> - compiled and installed findlib, menhir, ounit, ocamlcsv, frontc,
> xmllight, camomile, batteries
> 
> I have a problem with camlzip. In fact, the problem is not really ocaml-
> related... I do not know how to compile zlib with mingw64-i686-gcc, and use
> it to compile camlzip?

I use the following two commands to compile zlib 1.2.5 (with shared lib support) with normal 32-bit mingw:

sed -i -e "s/MODE=0/MODE=1/" -e "s/)gcc/\0 -mno-cygwin/" win32/Makefile.gcc
make BINARY_PATH=C:/Dev/OCaml/bin LIBRARY_PATH=C:/Dev/OCaml/lib INCLUDE_PATH=C:/Dev/OCaml/lib -f win32/Makefile.gcc all install

Presumably a few tweaks at the top of Makefile.gcc should allow you to compile a 64-bit version?

For camlzip 1.04 I add the following META file (borrowed from BSD ports, IIRC):
---
name="zip"
version="1.04"
description="reading and writing ZIP, JAR and GZIP files"
requires="unix"
archive(byte)="zip.cma"
archive(native)="zip.cmxa"
linkopts = ""
---

You need to edit its Makefile - change ZLIB_LIB to -lzdll if you want to link against zlib1.dll (-lz will give you static linking). You need to change ZLIB_LIBDIR to be where you installed your custom zlib or the resulting binary will be linked against Cygwin's zlib (for me that's C:/Dev/OCaml/lib, therefore). I then build with make all allopt and install with ocamlfind install camlzip *.dll *.a zip.{cmxa,cm[aix],mli} {zlib,gzip}.{cm[ix],mli} META

The examples work and definitely don't depend on cygz.dll

HTH,


David


  parent reply	other threads:[~2011-08-10  8:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 14:35 Matthieu Dubuget
2011-08-08 19:25 ` Adrien
2011-08-10  8:25 ` David Allsopp [this message]
2011-08-10  9:42   ` Matthieu Dubuget
2011-08-10 10:55     ` Adrien
2011-08-12 11:55       ` David Allsopp
2011-08-12 12:00     ` David Allsopp
2011-08-12 13:07       ` Adrien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E51C5B015DBD1348A1D85763337FB6D9C23E6979@Remus.metastack.local \
    --to=dra-news@metastack.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=matthieu.dubuget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).