Browse thread
OCaml compilation
- Matthieu Dubuget
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Matthieu Dubuget <matthieu.dubuget@g...> |
| Subject: | OCaml compilation |
Hello,
I'm trying to compile ocaml (mingw) on XP.
I did not succeed, and could reproduce the very same behaviour on two
computers (a real one, and in a virtual machine).
On my main development system, the compilation does not fail. The
difference may be that I don't touch at my currently working cygwin
installation. During the two failing installs, I did install a fresh
cygwin. Is this a known problem?
Following are some (pseudo)code extracted from the script I use to make
my installation.
Can anyone spot a mistake, that would explain the failure ?
Thanks in advance.
Matt
> 1/ cygwin installation: (where setup.exe is downloaded from cygwin web
> site)
> setup.exe -s http://cygwin.cict.fr/ -R c:\cygwin -q -l c:\depot_cygwin
> -n -C Base -P
> wget,unzip,binutils,diffutils,gcc-core,gcc-mingw-core,make,mingw-runtime,ncurses,w32api,m4,time,patch
>
>
> 2/ home creation: (.bat script)
> ---
> @echo off
>
> c:
> chdir c:\cygwin\bin
> set LANG=fr_FR.UTF-8
> bash --login -i
> ---
>
> 3/ After home is created,
>
> export LANG=fr_FR.UTF-8
>
> is added into .bash_profile
>
> 4/ a cygwin session is launched
>
> 5/ ActiveTcl installation
>
> #!/bin/bash
> activetcl=ActiveTcl8.5.8.0.291595-win32-ix86-threaded.exe
> activetcldownload=http://downloads.activestate.com/ActiveTcl/Windows/8.5.8/${activetcl}
>
> tkroot=C:/tcl
> tkdll=tk85.dll
> tcldll=tcl85.dll
> download_file ${activetcl} ${activetcldownload}
> chmod +x ${downloaddir}/${activetcl}
> ${downloaddir}/${activetcl} --directory ${tkroot}
>
> 6/ disconnect (windows xp session), reconnect, launch cygwin
> (because ActiveTcl modifies environment (path addded))
>
> 7/ flexlink install
>
> here=`pwd`
> prefix=/home/matt
> appsprefix=${prefix}/apps
> prefixwin=C:/cygwin${prefix}
> appsprefixwin=${prefixwin}/apps
> downloaddir=${here}/download
> extractdir=${here}/extracted
> mkdir ${prefix}/apps
>
> extract_archive_zip "${downloaddir}/${flexarchive}" ${flexdestdir}
> cp /usr/bin/gcc-3.exe ${flexdestdir}/gcc.exe
> cp /usr/bin/cpp-3.exe ${flexdestdir}/cpp.exe
>
> echo 'export PATH="${flexdestdir}:$PATH' >> ${HOME}/.bash_profile"
>
> 8/ Edit .bash_profile
>
> export PATH="/home/matt/apps/flex:$PATH"
>
> 9/ OCaml building
>
> #!/bin/bash
> ocaml=ocaml-3.11.2
> ocamlarchive=${ocaml}.tar.bz2
> ocamldownload=http://caml.inria.fr/pub/distrib/ocaml-3.11/${ocamlarchive}
>
> download_file ${ocamlarchive} ${ocamldownload}
>
> #Extract
> extract_archive ${downloaddir}/${ocamlarchive} ${extractdir} ${ocaml}
>
> #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
>
> tklink='$(TK_ROOT)'
> cmd1="s|PREFIX=C:/ocamlmgw|PREFIX=$ocamldirwin|"
> cmd2="s|TK_ROOT=c:/tcl|TK_ROOT=$tkroot|"
> cmd3="s|TK_LINK=$tklink/bin/tk84.dll $tklink/bin/tcl84.dll
> -lws2_32|TK_LINK=${tklink}/bin/${tkdll} ${tklink}/bin/${tcldll}
> -lws2_32|"
> sed -i.bak \
> -e "$cmd1" \
> -e "$cmd2" \
> -e "$cmd3" \
> ${extractdir}/${ocaml}/config/Makefile
>
>
> cd ${extractdir}/${ocaml} && \
> make -f Makefile.nt world
>
> Fails during ocamlbrowser compilation:
>
>> gcc -mno-cygwin -O -mms-bitfields -Wall -Wno-unused
>> -I../../../byterun -IC:/tcl/include -c winmain.c
>> ../../../ocamlcomp.sh -o ocamlbrowser.exe -I
>> ../../../otherlibs/win32unix -I ../../../otherlibs/str -I
>> ../../../otherlibs/systhreads -I ../labltk -I ../lib -I ../support -I
>> ../../../parsing -I ../../../utils -I ../../../typing \
>> ../../../toplevel/toplevellib.cma \
>> unix.cma str.cma threads.cma -custom -ccopt "-link
>> -Wl,--subsystem,windows" labltk.cma jglib.cma \
>> list2.cmo useunix.cmo setpath.cmo
>> lexical.cmo fileselect.cmo searchid.cmo searchpos.cmo
>> shell.cmo help.cmo viewer.cmotypecheck.cmo editor.cmo main.cmo
>> winmain.o
>> ** Cannot resolve symbols for descriptor object:
>> _Tcl_AppendResult
>> _Tcl_CreateChannelHandler
>> _Tcl_CreateCommand
>> _Tcl_CreateInterp
>> _Tcl_CreateTimerHandler
>> _Tcl_DStringAppend
>> _Tcl_DStringFree
>> _Tcl_DStringInit
>> _Tcl_DeleteChannelHandler
>> _Tcl_DeleteTimerHandler
>> _Tcl_DoOneEvent
>> _Tcl_Eval
>> _Tcl_EvalFile
>> _Tcl_ExternalToUtfDString
>> _Tcl_Finalize
>> _Tcl_FindExecutable
>> _Tcl_Free
>> _Tcl_GetCommandInfo
>> _Tcl_GetInt
>> _Tcl_GetVar
>> _Tcl_Init
>> _Tcl_MakeFileChannel
>> _Tcl_MakeTcpClientChannel
>> _Tcl_Merge
>> _Tcl_ResetResult
>> _Tcl_SetResult
>> _Tcl_SetVar
>> _Tcl_SplitList
>> _Tcl_TraceVar
>> _Tcl_UntraceVar
>> _Tcl_UntraceVar2
>> _Tcl_UtfToExternalDString
>> _Tk_GeometryRequest
>> _Tk_Init
>> _Tk_MainLoop
>> _Tk_MainWindow
>> File "_none_", line 1, characters 0-1:
>> Error: Error while building custom runtime system
>> make[2]: *** [ocamlbrowser.exe] Erreur 2
>> make[2]: quittant le répertoire «
>> /cygdrive/m/projets/Install/InstallDevTools/install_ocaml/InstallPack/extracted/ocaml-3.11.2/otherlibs/labltk/browser
>> »