From: Trevor Jim <trevor@research.att.com>
To: caml-list@inria.fr
Subject: [Caml-list] Aqua (non-X) labltk on Mac OS 10
Date: Wed, 13 Nov 2002 00:24:22 -0500 [thread overview]
Message-ID: <2A8AAB12-F6C8-11D6-A773-00039393D0CC@research.att.com> (raw)
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:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>calc</string>
</dict>
</plist>
(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
next reply other threads:[~2002-11-13 14:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-13 5:24 Trevor Jim [this message]
2003-01-10 3:45 ` Ken Wakita
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2A8AAB12-F6C8-11D6-A773-00039393D0CC@research.att.com \
--to=trevor@research.att.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).