From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7A9gG4T006203 for ; Wed, 10 Aug 2011 11:42:17 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AooCANxQQk5KfVIukGdsb2JhbABBp0EIFAEBAQEJCQ0HFAQhgUABAQEBAwsHAhMEBwEFCAEbHAEBAwwGBQsJAQMJDQEIDwkDAgECAREMAQQBBQEDARgGDQEFAgEBFgiHTQKgMQqMMQqCS4RZO4htAgMGgzsBgwQEkwmFCms8hiI8M4Mt X-IronPort-AV: E=Sophos;i="4.67,349,1309730400"; d="scan'208";a="115475079" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Aug 2011 11:42:11 +0200 Received: by wwf27 with SMTP id 27so899246wwf.3 for ; Wed, 10 Aug 2011 02:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=3SMRTRsINhIrj5P9+z9WRYuA6T6EsBs5VwdGFKheQKk=; b=CwaTda5LiUJGNcPaMHWoL7iVeJya+EH8vXKH3lwuPjTWOKBLYO+VwhC3cKxa/cIMfs N3djW10yqe0iWfuttj3fU4yVYnzDiObLTa+n4BO2H/socW0QnDT+C02bHYGsx2GKHEzV BEvTwI0pfnzsIYVsDvrlXAS+RiyWdNN3Eko4w= Received: by 10.227.32.65 with SMTP id b1mr707591wbd.87.1312969330812; Wed, 10 Aug 2011 02:42:10 -0700 (PDT) Received: from [172.17.1.30] (papillon.metalscan.fr [93.95.58.150]) by mx.google.com with ESMTPS id eo18sm599145wbb.63.2011.08.10.02.42.09 (version=SSLv3 cipher=OTHER); Wed, 10 Aug 2011 02:42:09 -0700 (PDT) Message-ID: <4E42526F.8000200@gmail.com> Date: Wed, 10 Aug 2011 11:42:07 +0200 From: Matthieu Dubuget Reply-To: matthieu.dubuget@gmail.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110628 Thunderbird/5.0 MIME-Version: 1.0 To: Caml Mailing List CC: David Allsopp References: <4E3FF432.3000705@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Trying to setup mingw OCaml 3.12.1 + fresh cygwin Date: 10/08/2011 10:25 From: David Allsopp wrote: > 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? This is not 64 bits. i686-w64-mingw32 is 32 bits. But for this, I adapted some patches borrowed from bug #5179, that may interest you. Here is the way I follow in order to install everything. (I have scripts for this, but they are not generic…) First, install cygwin, with something like this: > @echo off > > rem "miniInstallPack/" is supposed to be on the user's desktop > > rem If you put "depot_cygwin/" in "miniInstallPack/" from a previous > rem cygwin install, it will be used to save some bandwidth > IF NOT EXIST depot_cygwin GOTO :NOCYGWINDEPOTDIR > > rem But only if you don't already have a c:\depot_cygwin > IF EXIST c:\depot_cygwin GOTO :NOCYGWINDEPOTDIR > XCOPY /E /Q /Y depot_cygwin c:\depot_cygwin\ > :NOCYGWINDEPOTDIR > > setup.exe -s ftp://mirror.switch.ch/mirror/cygwin -R c:\cygwin -q -l > c:\depot_cygwin -n -C Base -P > wget,unzip,binutils,diffutils,file,gdbm,make,ncurses,patchutils,m4,time,patch,autoconf,automake,mingw64-i686-gcc-core,vim > c: > chdir c:\cygwin\bin > > rem création du home > bash --login -i -c "exit" > > bash --login -c "echo 'export TMP=/tmp' >> .bashrc" > bash --login -c "echo 'export TEMP=/tmp' >> .bashrc" > bash --login -c "cp -a `cygpath -d -D -m`/miniInstallPack ." > rem the following script is to use kitty > bash --login -c "cd miniInstallPack && bash 12_kittycyg.sh" > bash --login -c "[ ! -e 'miniInstallPack/download' ] && mkdir > miniInstallPack/download" > bash --login -c "[ ! -e 'miniInstallPack/extracted' ] && mkdir > miniInstallPack/extracted" > > echo > echo Now, you'll have to log-in > echo cd miniInstallPack > echo and run 00_install_suite.sh > echo 00_install_suite.sh is something like that: > #!/bin/bash > . installation_configuration.sh > > rm -rf `cygpath -d -D -m`/miniInstallPack > rm -rf depot_cygwin > > . ./02_flexlink.sh > . ./03_tcl.sh > . ./04_ocaml.sh > . ./05_findlib.sh > . ./06_menhir.sh > . ./11_emacs.sh > . ./20_caml_mode.sh > . ./19_tuareg.sh > . ./15_bitstring_improved.sh > . ./14_ounit.sh > . ./21_ocamlcsv.sh > . ./25_frontc.sh > . ./22_magit.sh > . ./23_xmllight.sh > . ./08_camomile.sh > . ./09_batteries.sh > . ./24_zlib.sh > . ./24_camlzip.sh > ... where installation_configuration.sh contains some functions and variables: > #!/bin/bash > > here=`pwd` > prefix=/home/matt > appsprefix=${prefix}/apps > prefixwin=C:/cygwin${prefix} > appsprefixwin=${prefixwin}/apps > downloaddir=${here}/download > extractdir=${here}/extracted > ocaml=ocaml-3.12.1 > > emacs=emacs-23.3 > emacsarchive=${emacs}-bin-i386.zip > emacsdownload=http://ftp.gnu.org/pub/gnu/emacs/windows/${emacsarchive} > emacsdestdir=${appsprefix}/emacs > > ocamldir=ocamlmgw > ocamldirwin=${prefixwin}/${ocamldir} > ocamllib=${prefix}/${ocamldir}/lib > bindir=${prefix}/${ocamldir}/bin > tkroot=c:/tcl > gtkdestdir=${appsprefix}/GTK > > # download_file file url > download_file (){ > if [[ -e ${downloaddir}/$1 ]] > then > echo "'$1' already there." > else > echo "'$1' is not there: downloading..." > echo > wget --no-check-certificate -O ${downloaddir}/$1 $2 > echo > > if [[ -e ${downloaddir}/$1 ]] > then > echo "DOWNLOAD FINISHED -> OK" > else > echo "FAILED. exiting" > exit 1 > fi > fi > } > # extract_archive archiv dest dir > extract_archive (){ > if [[ -e $2/$3 && -d $2/$3 ]] > then > echo "'$3' already extracted" > else > echo "Extracting '$3'..." > tar -xaC $2 -f $1 > fi > } > > # extract_archive_zip archive destdir > extract_archive_zip (){ > if [[ -e "$2" && -d "$2" ]] > then > echo "'$2' already extracted" > else > echo "Extracting '$2'..." > unzip -d "$2" "$1" > fi > } > > # extract_archive_zip_overwrite archive destdir > extract_archive_zip_overwrite (){ > unzip -q -o -d "$2" "$1" > } > > affiche_install (){ > echo > echo ----------------------- > echo $1 > echo ----------------------- > echo > } > > prepend_path (){ > export PATH="$1:$PATH" > } > > append_path (){ > export PATH="$PATH:$1" > } Flexlink is a patched version (see bug #5179) 03_tcl.sh: > #!/bin/bash > affiche_install "TCL (Activetcl8.5.9.2.294317-win32-ix86-threaded)" > activetcl=ActiveTcl8.5.9.2.294317-win32-ix86-threaded.exe > activetcldownload=http://downloads.activestate.com/ActiveTcl/releases/8.5.9.2/${activetcl} > > download_file ${activetcl} ${activetcldownload} > chmod +x ${downloaddir}/${activetcl} > ${downloaddir}/${activetcl} --directory ${tkroot} 04_ocaml.sh: > #!/bin/bash > cd ${here} > affiche_install "OCaml" > ocamlarchive=${ocaml}.tar.bz2 > ocamldownload=http://caml.inria.fr/pub/distrib/ocaml-3.12/${ocamlarchive} > > # download > download_file ${ocamlarchive} ${ocamldownload} > > #Extract > extract_archive ${downloaddir}/${ocamlarchive} ${extractdir} ${ocaml} > > #Patch (for cygwin mingw cross compilation use) > cd ${extractdir}/${ocaml} && patch -p1 -i ../../ocaml-i686-mingw64-patch > > #Configure > cp ${extractdir}/${ocaml}/config/s-nt.h ${extractdir}/${ocaml}/config/s.h > cp ${extractdir}/${ocaml}/config/m-nt.h ${extractdir}/${ocaml}/config/m.h > cp ${extractdir}/${ocaml}/config/Makefile.mingw > ${extractdir}/${ocaml}/config/Makefile > > #We want to install in a different place > cmd1="s|PREFIX=C:/ocamlmgw|PREFIX=$ocamldirwin|" > sed -i.bak -e "$cmd1" ${extractdir}/${ocaml}/config/Makefile > > cd ${extractdir}/${ocaml} && \ > make -f Makefile.nt world && \ > make -f Makefile.nt opt && \ > make -f Makefile.nt opt.opt && \ > make -f Makefile.nt install > > echo "export PATH=\$PATH:${bindir}" >> ${HOME}/.bashrc > append_path "${bindir}" > cd ${here} 05_findlib.sh > #!/bin/bash > cd ${here} > affiche_install "Findlib" > > findlib=findlib-1.2.7 > findlibarchive=${findlib}.tar.gz > findlibdownload=http://download.camlcity.org/download/${findlibarchive} > > download_file ${findlibarchive} ${findlibdownload} > extract_archive ${downloaddir}/${findlibarchive} ${extractdir} ${findlib} > > #If configure is not patched, a trailing \r\n remains in camlp4's META > #file, which breaks it's use with ocamlfind > cd ${extractdir}/${findlib} && \ > sed -i -e "s/camlp4 -where/camlp4 -where | tr -d '\\\\015'/" configure > && \ > ./configure -cygpath && \ > make all && make opt && make install > cd ${here} ... If somebody wants them, I can share those recipes. Salutations Matt