$Id$

S-MySQL Installation instructions.

[We need an autoconfigure script, but in the meantime you'll
may follow the steps below.]

Installation steps:

1. Create a directory S-MySQL and untar the gziped file inside 

   mkdir S-MySQL
   cd S-MySQL
   tar xzf SMySQL_0.4.1.tar.gz
 
   or

   gzip -d -c SMySQL_0.4.1.tar.gz | tar xf -

2. Create an S-Plus chapter with

   Splus CHAPTER

3. Edit the newly created "makefile" above and make sure the following 
   macros point to the correct MySQL library and header installation 
   directories:

   a. Add the following 2 macros for MySQL libraries and include files
      (you may insert them after, say, the line SHELL=/bin/sh)

         MYSQL_LIB_DIR = /usr/local/lib/mysql         ## change as appropriate
         MYSQL_INC_DIR = /usr/local/include/mysql     ## change as appropriate

    b. Edit the flags LOCAL_CFLAGS= and LOCAL_LIBS as follows:
       
       LOCAL_CFLAGS = -I$(MYSQL_INC_DIR) -DUSING_SPLUS=6    ## of 5, for Splus 5.x
       LOCAL_LIBS = -L$(MYSQL_LIB_DIR) -lmysqlclient 

4. "Boot" the Splus5 chapter by typing (see p.233 in Chambers' Programming 
   with Data):

   Splus make boot

5. Compile the C code

   Splus make S.so

6. Install the help pages 

   cd help
   Splus HINSTALL ../.Data *.sgml
   cd ..
   Splus BUILD_JHELP S-MySQL

7. Depending on your MySQL setup, you may or may not 
   need to include the MySQL lib directory in your LD_LIBRARY_PATH
   e.g., 
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/mysql
   (the directory where the MySQL shared library libmysqlclient.so can
   be found).

That's it.

S/W Requirements:

   MySQL client library ("libmysqlclient.so") and header files
   (see www.mysql.com).
  
   For Linux/intel you may use the binary rpms client+devel+shared, 
   and make sure you also have the header files, they are *NOT* included 
   in the following
	MySQL-client-3.23.17-1.i386.rpm
	MySQL-shared-3.23.17-1.i386.rpm

   but they may be included in newer rpm versions.

   For Linux/intel binary rpms 3.23.25 and 3.23.26 beta (client+devel+shared) 
   you may need to prepend the library -lz in the makefile LOCAL_LIBS macro (a 
   symptom of this problem is an "undefined symbol uncompress in ./S.so" when 
   invoking Splus), i.e.,  you may need
        LOCAL_LIBS = -lz -L$(MYSQL_LIB_DIR) -lmysqlclient

   On Sun, you also need the GNU files getopt.c and getopt.h, which are 
   available in the MySQL source distribution (and from the GNU glibc stuff).
   Don't forget to add them to the makefile macro SRC!

-------------------------------------------------------------------
So far tested on the following platforms:

   Linux RedHat 6.0, 6.1, 6.2, 7.0
     MySQL 3.23.26 and 3.23.25 (client, devel and shared libraries 
     RPM binaries) plus a full 3.22.17 distribution and full 3.23.56
     distribution.
     S4 (June 22, 1999)
     Splus 5.1
     Splus 6.0 Beta 2, 6.1.2

   Solaris 5.6 sparc (Sun's C compiler)
     MySQL (client) 3.22.26a
     Splus 5.1
     Splus 6.0 Beta 2

