Here are the steps you need to take to make this package.

1) Get the MySQL sources. Yes, you need the MySQL sources. If you do
   not have MySQL installed, build and install it. I will call your
   MySQL source directory $MYSQL in what follows.

2) Edit $MYSQL/client/libmysql.c. If the definition of
   mysql_init (line 897 in MySQL 3.22.23b) looks like this

     MYSQL * STDCALL mysql_init(MYSQL *mysql)

   change it to these two lines:

     MYSQL * STDCALL
     mysql_init(MYSQL *mysql)

   this simply fixes an inconsistency in the sources which makes life
   simpler for the perl script you'll be running to generate the STk
   foreign function interface. Note that this has already been
   corrected in the to-be-released mysql versions > 3.22.23b so if you
   know you have one of these, you shouldn't need to make this change.

3) Edit the Makefile. There are 4 macros at the top that you will
   likely want to change. You will definitely have to change some of
   them. The full set is:

     MYSQL_SRC_ROOT     - The root directory of your MySQL sources (see step 1).
     MYSQL_INSTALL_ROOT - Where MySQL is installed on your system
     STK_INSTALL_DIR    - Where to install the STk library interface.
     LIB_INSTALL_DIR    - Where to install the dynamic C library.

4) If your perl is not in /usr/bin, fix the first line of
   extract-api.pl

5) Type make. You should see (and ignore) a single warning message,
   which looks like this:

     extract-api.pl: stk return type undefined for C type
     'MYSQL_FIELD'. Stubbing 'mysql_fetch_field_direct'.

   This is a function in the MySQL API that I haven't built a
   workaround for yet. If it's not a function you're in the habit of
   using, you have nothing to worry about.

6) Run 'make install' to install the libraries. You might want to
   change the permissions on the 2 installed files.

7) If you would like to test if things are working, you can do that as
   follows:

   cd to the test directory. Edit the first lines of the scripts
   create-ws-tables.stk and ws-test.stk to indicate where your STk
   binary is installed. Edit ws-sql-common.stk and change the first
   few lines to indicate a valid MySQL user, password, and host for
   the test program to connect to. The test program will create a
   database called "stk_workspace", - you can change this if you're
   already using that name for some reason.

   Make sure MySQL is running on the machine
   indicated in the variable WS:DB-HOST in ws-sql-common.stk.

   Run the script create-ws-tables.stk. You should see output like
   this:

     Created new database 'stk_workspace'.
     Selected database 'stk_workspace'.
     Created new table 'objects'.
     Created new table 'inclusion'.
     Database and tables successfully created.

   This already indicates your STk/MySQL connection is running
   fine. For a more rigorous test, run the script ws-test.stk which
   will generate output that looks like this:

     Test 1  OK
     Test 2  OK
     Test 3  OK
     Test 4  OK

   For about 70 tests. When you're happy, drop the 'stk_workspace' database via

     mysqladmin drop stk_workspace



Terry Jones (terry@cliffs.ucsd.edu).
June 25, 1999
