From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA07864; Wed, 7 Aug 2002 16:23:23 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA07537 for ; Wed, 7 Aug 2002 16:23:22 +0200 (MET DST) Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g77ENL528740 for ; Wed, 7 Aug 2002 16:23:21 +0200 (MET DST) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto4.wanadoo.fr (6.5.007) id 3D49FD320023C7B5; Wed, 7 Aug 2002 16:23:21 +0200 Received: from warp (80.13.116.114) by mel-rta9.wanadoo.fr (6.5.007) id 3D49FFB700227D28; Wed, 7 Aug 2002 16:23:21 +0200 Message-ID: <000801c23e1d$f399c5b0$0700a8c0@warp> From: "Nicolas Cannasse" To: , "Ohad Rodeh" References: Subject: Re: [Caml-list] Packaging a caml library a DLL Date: Wed, 7 Aug 2002 16:23:07 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > List, > I'm having a lot of trouble packaging a caml library (Ensemble) as a > DLL on win32. Creating a win32 static library is easy, shared libraries on > Unix > are a breeze, however, win32 DLLs are really problematic. > > Has anybody been able to do this? any example makefiles? Here's the Makefile Harry Chomsky & me are using for the Win32 API. Look at "dynamic" built. It's working without any problem with bytecode compilation. However, native compilation with DLL won't work due to the need to link with ocamlrun.lib. Nicolas Cannasse ---------------- CFLAGS=-ccopt /W3 -ccopt /YX -ccopt /Fpwin32.pch WINLIBS=user32.lib gdi32.lib shell32.lib advapi32.lib comctl32.lib comdlg32.lib CCWINLIBS=-cclib user32.lib -cclib gdi32.lib -cclib shell32.lib -cclib advapi32.lib -cclib comctl32.lib -cclib comdlg32.lib EXTFLAGS= -I ext MODULES= win32_bitmap.+ ..... ( other C files ) ###################################################################### # TARGETS : all : static dynamic opt mkwinapp static : libwin32.lib win32.cma lkwinapp.obj test_static.exe dynamic : dllwin32.dll win32.cma test_dynamic.exe opt : libwin32.lib win32.cmxa lkwinapp.obj test_opt.exe mkwinapp : mkwinapp.exe ###################################################################### # BUILDS : libwin32.lib : win32_core.sobj $(MODULES:+=sobj) -@del $@ 2>NUL lib /out:$@ $** dllwin32.dll : win32_core.dobj $(MODULES:+=dobj) -@del $@ 2>NUL link $(WINLIBS) ocamlrun.lib /dll /out:$@ $** win32.cma : win32_core.cmo $(MODULES:+=cmo) win32.cmo ocamlc -a -o $@ -cclib -lwin32 $(CCWINLIBS) -dllib dllwin32 $** win32.cmxa : win32_core.cmx $(MODULES:+=cmx) win32.cmx ocamlopt -a -o $@ -cclib -lwin32 $(CCWINLIBS) $** win32_core.cmi : win32_core.mli ocamlc -c $** win32_core.cmo : win32_core.cmi win32_core.ml win32_core.cmx : win32_core.cmi win32_core.ml win32.cmo : win32_core.cmo $(MODULES:+=cmo) win32.ml win32.cmx : win32_core.cmx $(MODULES:+=cmx) win32.ml mkwinapp.exe : mkwinapp.ml ocamlc -o $@ unix.cma $** test_static.exe : win32.cma test.ml test_res.obj libwin32.lib lkwinapp.obj ocamlc -o $@ -custom win32.cma test.ml test_res.obj lkwinapp.obj test_dynamic.exe : win32.cma testnores.ml ocamlc -o $@ win32.cma testnores.ml test_opt.exe : win32.cmxa test.ml test_res.obj libwin32.lib lkwinapp.obj ocamlopt -o $@ win32.cmxa test.ml test_res.obj lkwinapp.obj ###################################################################### # SUFFIXES : .c.obj : ocamlc $(CFLAGS) $*.c .c.sobj : ocamlc $(CFLAGS) -ccopt /Fo$@ $*.c .c.dobj : ocamlc $(CFLAGS) -ccopt /Fo$@ -ccopt /MD $*.c .rc.obj : rc $*.rc cvtres /machine:ix86 $*.res @del $*.res .ml.cmo : ocamlc $(EXTFLAGS) -c $*.ml .ml.cmx : ocamlopt $(EXTFLAGS) -c $*.ml ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners