Date: 10/08/2011 10:25
From: David Allsopp <[email protected]> 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
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs