Re: whim configure script needs "jpeg library" -- what does that mean exactly



On Apr 20, 10:54 am, George Peter Staplin <georg...@xxxxxxxxxxxx>
wrote:
Webb S. wrote:

Try editing the build.conf that the configure.tcl produced.

edit these in the build.conf:
LD gcc
LD_FLAGS -shared

make them be:
LD ld
LD_FLAGS -dylib

Did this and got:

(0) foobar:Whim-2399 [0]% /usr/local/bin/tclsh8.5
build.tcl                    <1204>
BUILDING:/Users/wsprague/Whim-2399/build/arch/i386/Darwin/
megaimage.dylib
gcc -O -D_XOPEN_SOURCE=500 -D_SVID_SOURCE -D_ISOC99_SOURCE -pipe -fPIC
-DPIC -DUSE_X11 -DUSE_SHM -DUSE_TCL_STUBS -DUSE_TK_STUBS -finline-
functions -DLITTLE_ENDIAN=1 -DBIG_ENDIAN=2 -DBYTE_ORDER=LITTLE_ENDIAN -
I/usr/local/include -I/usr/local/include  -I../include -c
megaimage_compile.c
ld -dylib megaimage_compile.o /usr/local/lib/libtclstub8.5.a -lm -o /
Users/wsprague/Whim-2399/build/arch/i386/Darwin/megaimage.dylib
ERROR:ld: Undefined symbols:
___divdi3

That appears to be some sort of libgcc issue with a missing symbol that
libgcc provides.  I looked up how I did this with another project.  It
seems I sent you in the wrong direction by suggesting ld, sorry about that.
I had forgotten that I did use gcc.  While it's possible to use ld, it's
more work, so we might as well let gcc do some of the heavier lifting.

Try:
LD gcc
LD_FLAGS "-dynamiclib -Wl,-single_module"

You might need to change that last part to this if the build fails:

LD_FLAGS "-dynamiclib -Wl,-single_module -flat_namespace"

-single_module should be the default in Leopard based on the manual.  If
you're using an older Mac release it might not be.

I haven't tried to build Whim yet on the Mac, and I haven't built Tcl
extensions from scratch on a Mac.  I have however build some extensions
that used TEA that were a bit broken without some Makefile edits.  If
anyone here at comp.lang.tcl has further advice please speak up.

By the way if the resulting binary doesn't work you can use this to start
over:
tclsh build.tcl build.conf clean

I suggest you make certain you're using an X11 libtk that works with
XQuartz.

Not to be stupid, but as opposed to what?  And how might I make sure?

There are 2 versions of Tk for the Mac.  The Mac ships with Tk 8.4 in
Leopard.  That particular build uses Mac-specific code, and doesn't require
X11.  You can also build Tk from sources or perhaps via an installer, and
have it use the XQuartz in /usr/X11 (assuming you have that installed).
Whim uses X11, which you can get from here (I suggest the .dmg downloads):

http://xquartz.macosforge.org/trac/wiki

Apple also provides XQuartz on the OS install media AFAIK, but it may be a
different (older) version than what you find at the macosforge.org site.
Some Apple software updates also will update X11 IIRC, if it's installed.

In any case: Whim requires an X11 Tk, because it's an X11 window manager.
It's probably best adapted for use with the fullscreen option of recent
XQuartz, which can be toggled with: "command-option-a" when you enable the
fullscreen option in the XQuartz preferences.  Remember the
command-option-a or write it down, so that you can remember how to get out
of it if needed.

You can build Tk for X11 using macports I believe, though in practice I
manually build Tcl and Tk on some systems using: --with-tcl (for Tk)
and --prefix ./configure options.

I don't know which version of Tk ActiveState provides for the Mac.

Thanks!

You're welcome.  Good luck :)

-George

I made your changes, also changed the paths in the conf to only use
macports and /usr (and not the /usr/local stuff where activestate
installs to), also reinstalled Tck/Tk w/o quartz option, and got the
following :

(127) foobar:Whim-2399 [0]% tclsh
build.tcl
<1244>
BUILDING:/Users/wsprague/Whim-2399/build/arch/i386/Darwin/
jpegext2.dylib
gcc -O -D_XOPEN_SOURCE=500 -D_SVID_SOURCE -D_ISOC99_SOURCE -pipe -fPIC
-DPIC -DUSE_X11 -DUSE_SHM -DUSE_TCL_STUBS -DUSE_TK_STUBS -finline-
functions -DLITTLE_ENDIAN=1 -DBIG_ENDIAN=2 -DBYTE_ORDER=LITTLE_ENDIAN -
I/opt/local/include -I/opt/local/include -I/opt/local/include -I../
include -c jpegext2_compile.c
gcc -dynamiclib -Wl,-single_module jpegext2_compile.o /opt/local/lib/
libtclstub8.5.a /opt/local/lib/libjpeg.a -lm -o /Users/wsprague/
Whim-2399/build/arch/i386/Darwin/jpegext2.dylib
ERROR:ld: Undefined symbols:
_megaimage_get_from_obj
_megaimage_new_obj
/usr/bin/libtool: internal link edit command failed

I have a linux box in my trunk, and I might confine this experiment to
that machine since the Mac might be more of a headache than I feel
like dealing with at the moment, though you have definitely tried your
best ;)

W
.