January 31, 2007 Archives

01.31.2007 14:14

Installing sqsh on OS X 10.4

If forced to use an MS-SQL database, I find it much easier and more convenient to use the excellent sqsh shell. On our Ubuntu boxes, installing it was as simple as apt-get install sqsh. Unfortunately, DarwinPorts doesn't include it. Building from source was somewhat problematic due to OS X's none-GNU-readline readline.h (it's actually part of the BSD editline library).

Here's what I needed to do:

  1. Install FreeTDS:

    port install freetds
    
    
  2. Download and untar sqsh.

  3. Configure as you would normally, setting $SYBASE to point to the top of the FreeTDS install:

    SYBASE=/opt/local ./configure --with-readline
    
    
  4. Edit src/Makefile and append freetds to line #18 so it looks like this:

    SYBASE_INCDIR = -I$(SYBASE_OCOS)/include/freetds
    
    
  5. Modify the header/library paths for libreadline to point to the version from DarwinPorts:

    READLINE_LIBDIR =  -L/opt/local/lib
    READLINE_INCDIR =  -I/opt/local/include/
    
    
  6. make and make install


Posted by Insyte | Permanent Link