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 PAA05808; Wed, 13 Nov 2002 15:19:11 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA05783 for caml-list@pauillac.inria.fr; Wed, 13 Nov 2002 15:19:11 +0100 (MET) 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 GAA23872 for ; Wed, 13 Nov 2002 06:25:20 +0100 (MET) Received: from mail-green.research.att.com (H-135-207-30-103.research.att.com [135.207.30.103]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gAD5PJ117461 for ; Wed, 13 Nov 2002 06:25:20 +0100 (MET) Received: from bigmail.research.att.com (bigmail.research.att.com [135.207.30.101]) by mail-green.research.att.com (Postfix) with ESMTP id BA5F11E450 for ; Wed, 13 Nov 2002 00:24:12 -0500 (EST) Received: from research.att.com (trevor166.research.att.com [135.207.35.166]) by bigmail.research.att.com (8.11.6+Sun/8.11.6) with ESMTP id gAD5Mpv01338 for ; Wed, 13 Nov 2002 00:22:52 -0500 (EST) Date: Wed, 13 Nov 2002 00:24:22 -0500 Mime-Version: 1.0 (Apple Message framework v548) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: [Caml-list] Aqua (non-X) labltk on Mac OS 10 From: Trevor Jim To: caml-list@inria.fr Content-Transfer-Encoding: 7bit Message-Id: <2A8AAB12-F6C8-11D6-A773-00039393D0CC@research.att.com> X-Mailer: Apple Mail (2.548) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I managed to get labltk working in Mac OS 10 with the Aqua (non-X) version of Tk. It's a bit clunky but maybe someone who knows more about these things can clean it up. Here's how it goes: You need Mac OS 10.x with the Developer's CD installed (I'm running 10.2.2). Obtain the tcl-8.4.1 and tk-8.4.1 source from http://tcl.sourceforge.net/. (There now seems to be a binary distribution, but that wasn't available when I started this. Someone else can give that a try.) Follow these instructions to compile and install Tcl/Tk (summarized from http://mini.net/tcl/4052): tar zxvf tcl8.4.1-src.tar.gz tar zxvf tk8.4.1-src.tar.gz mv tcl8.4.1 tcl mv tk8.4.1 tk cd tcl/macosx make >& make.log sudo make install cd ../../tk/macosx make >& make.log sudo make install (NOTE: the mv's are in fact necessary.) Obtain the ocaml-3.06 source and apply Jacques' patch so that it will compile with tcl/tk 8.4. (See http://groups.google.com/groups?selm=fa.i2v96ov.1p7cmbc%40ifi.uio.no) In the ocaml source directory do ./configure -tkdefs "-I/Library/Frameworks/Tcl.framework/Headers -I/Library/Frameworks/Tk.framework/Headers" -tk-no-x11 -tklibs "-F/Library/Frameworks/Tcl.framework -framework Tcl -F/Library/Frameworks/Tk.framework -framework Tk" make world make opt sudo make install make clean Now you should be able to compile programs using labltk; but it takes a bit more to get your program to run properly. For example, in the ocaml source directory, do cd otherlibs/labltk/examples_labltk ocamlc -o calc -I +labltk labltk.cma calc.ml You now have a compiled calc program that will bring up a window, but if you do ./calc you will get an error message SetFrontProcess failed,-606 when you try to use the calculator. To fix this you have to make an "application bundle", this is how applications are packaged up on Mac OS 10. So do mkdir calc.app mkdir calc.app/Contents mkdir calc.app/Contents/MacOS mv calc calc.app/Contents/MacOS Now using your favorite editor create a file calc.app/Contents/Info.plist with the following contents: CFBundleExecutable calc (For a program named foo, you would of course substitute foo for calc in the Info.plist file.) That's it. You can run the application from a terminal by doing open calc.app Or, you can double-click calc.app from the Finder. Note, the .app extension will be hidden by the Finder. Neither of these methods allows command-line arguments to be passed to the program; I don't know how to do that. The labltk toplevel doesn't quite work -- the SetFrontProcess failure comes up. Maybe someone else can fix that. -Trevor ------------------- 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