Tcl and Mac fans,

Unknown to me, I have been using programs that use Tcl/Tk for quite a while, however, I recently started playing with Tk bindings in my own projects.  I starting thinking that maybe I should download and install TclTkAquaBI-8.4.10.0 from http://tcltkaqua.sourceforge.net/ (you know, maybe it would make the output prettier or I'll be able to use cool new widgets).  The installation seemed to go fine and I noticed no differences in anything for a while.

Then I tried to install a piece of software through MacPorts.  I didn't know it used Tcl but sure enough I get this:

no suitable image found.  Did find:
        /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib: mach-o, but wrong architecture
    while executing
"load /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib"
    ("package ifneeded" script)
    invoked from within
"package require Pextlib 1.0"
    (procedure "mportinit" line 382)
    invoked from within
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, no suitable image found.  Did find:
        /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib: mach-o, but wrong architecture

Yikes, it looks like I was running programs that use a Tcl installation, perhaps installed by MacPorts.  It says that the architecture is wrong, my Macbook Pro has an Intel chip in it.  Uh, oh:

smithzv@belial:~$ file /usr/bin/tclsh8.4
/usr/bin/tclsh8.4: Mach-O executable ppc

smithzv@belial:~$ file /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib
/opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib: Mach-O dynamically linked shared library i386

The .dmg didn't overtly say anything about PPC, but this seems like a problem.  It looks like the PPC executable runs, but PPC emulated processes do not mix with Intel shared libraries.

In vain I try to undo the damage by running the uninstall script included in the .dmg file.  Then, I get:

/opt/local/bin/port: line 3: /usr/bin/tclsh: No such file or directory
/opt/local/bin/port: line 3: exec: /usr/bin/tclsh: cannot execute: No such file or directory

Hmmm, the unistall must have removed these files.  Okay, but...

smithzv@belial:~$ which tclsh
/opt/local/bin/tclsh
smithzv@belial:~$ tclsh
% puts hello
hello

So I still have the MacPorts version installed and working but it is not where MacPorts wants it to be.  It is looking in /usr/bin.  But it was always looking there, so I must have over written it (probably symlinks) when I installed the new package, and the uninstall deleted it, leaving nothing.  Assumedly this breaks every program that has the path to the tcl interpreter or wish hard coded into it and probably more.

Do you think this is what is going on?  Was I stupid to do this in the first place (probably)?  I guess OS X already comes with Tcl/Tk pre-installed or I installed long ago with MacPorts.

Now the real question, how can I fix this?  I guess the two routes I see are to fix the new version  (which seems to be PPC so less desirable) or figure out how to revert to/fix the old.  I know how to do neither.

Anyway, my computer is crippled; any help is greatly appreciated.  A disclaimer, though, I know pretty much nothing about Tcl, or about OS X for that matter (more of a Linux guy).  I have been pretty much tip-toeing around in OS X, but it looks like I finally got bit by something.  Anyway, be forewarned that any issue I am having could be due to some bone-head move on my part.  Thanks.

Freaking out,
Zach