# -*-mode: text; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
###########################################################################
# HOWTO compile tix Mac OS X 10.0.4, XFree4.1.0  (9/5/01: msereno@ucsd.edu)
###########################################################################

### compile tcl 8.3.3 (configure, make)
% cd /tmp
% wget ftp://ftp.scriptics.com/pub/tcl/tcl8_3/tcl8.3.3.tar.gz
% tar zxvf tcl8.3.3.tar.gz
% cd tcl8.3.3/unix
% ./configure --enable-shared --prefix=/usr/local --exec-prefix=/usr/local
% make

### compile tk 8.3.3 (patch configure, configure, make)
% cd /tmp
% wget ftp://ftp.scriptics.com/pub/tcl/tcl8_3/tk8.3.3.tar.gz
% tar zxvf tk8.3.3.tar.gz
% cd tk8.3.3/unix

Before running tk8.3.3/unix/configure, insert two new sections in it:

1) after line 1936 (step 3, system-specific configs) insert these 14 lines:
    Rhapsody-*|Darwin-*)
        SHLIB_CFLAGS="-fno-common"
        SHLIB_LD="cc -dynamiclib -undefined suppress \${LDFLAGS} \
          -compatibility_version ${TK_MAJOR_VERSION} \
          -current_version \${VERSION} \
          -install_name ${PREFIX}/lib/\${TK_LIB_FILE}"
        SHLIB_LD_LIBS=""
        SHLIB_SUFFIX=".dylib"
        DL_OBJS="tclLoadDyld.o"
        DL_LIBS=""
        LDFLAGS=""
        LD_SEARCH_FLAGS=""
        CFLAGS_OPTIMIZE="-O3"
            ;;

2) after line 2337 (shared lib flags for gcc) insert these 2 lines:
    Rhapsody-*|Darwin-*)
        ;;

Now configure and make:

% ./configure --enable-shared --prefix=/usr/local --exec-prefix=/usr/local
% make

### compile tix 8.1 (configure, manually patch Makefile, make)
% /usr/bin/ranlib /tmp/tcl8.3.3/unix/libtclstub8.3.a
% /usr/bin/ranlib /tmp/tk8.3.3/unix/libtkstub8.3.a
% cd /tmp
% wget http://prdownloads.sourceforge.net/tix/tix-8.1.4.tar.gz
% tar zxvf tix-8.1.4.tar.gz
% cd tix-8.1.4/unix
% ./configure --enable-shared

Before running make, edit tix-8.1.4/unix/Makefile generated
by tix-8.1.4/unix/configure (don't include quotes):

  1) change all "$@_OBJECTS" to "TIX_OBJECTS"
  2) change value of LDFLAGS_DEFAULT from "@LDFLAGS_OPTIMIZE@" to "-O3"
  3) add "-I/usr/X11R6/include" to list of paths after "INCLUDES ="
  4) add "$(TK_LIBS)" to end of line beginning with "${SHLIB_LD}"
  5) add "$(TK_LIBS)" to beginning of line with "-o $(TIX_EXE_FILE)"
  6) change value of -install_name from "${LIB_RUNTIME_DIR}/${TCL_LIB_FILE}"
       to "/usr/local/lib/libtix8.1.dylib"

Now make:

% make

### install (not shown)
If shared libs and tcl/tk script libs *not* installed in /usr/local/lib,
then setenv DYLD_LIBRARY_PATH to colon-separated list of dirs that contain
shared libs (and setenv TCL_LIBRARY and TK_LIBRARY for script libs).

