All SQL Relay components should build and run on relatively modern versions of Linux, Unix or Unix-like systems including Solaris, FreeBSD, NetBSD, OpenBSD, Mac OS X, Haiku and Cygwin, though there are currently some performance and compatibility issues under Cygwin.
x86 and x86_64 platforms are supported, as are non-x86 architectures such as ARM, Sparc, Mips, PPC and others.
uClib/Linux-based systems should also be supported.
The command line clients and C, C++ and .NET API's should build and run natively on Windows using Visual Studio but the server components do not yet build and run natively on Windows.
PrerequisitesBefore you can compile SQL Relay, you will need to install some pre-requisites.
To build any part of SQL Relay, you need to install the Rudiments library, which is available at: rudiments.sourceforge.net
To build the non-C/C++ API's, you need to install one or more of Perl, PHP, Python, Ruby, TCL, Java (see note), Zope or Erlang. Note that these API's are not supported natively on Windows though many do work under Cygwin.
(note: The GNU gcj compiler appears to be sufficient to compile the SQL Relay Java API and SQL Relay's configure script will detect it and use it if it's available. But the GNU gij JVM appears to currently have a bug preventing programs which use the SQL Relay Java API from working in some cases. Specifically, if a method which should return a String returns a null, the gij JVM throws a NullPointerException. The GNU gij JVM exhibits this behavior with code compiled with either the GNU cgj compiler or non-GNU javac compilers. And non-GNU JVM's successfully run code generated by either the GNU gcj compiler or non-GNU javac compilers.)
To build the C, C++, .NET and ADO.NET API's natively on Windows, you need to install Microsoft Visual Studio or Microsoft Visual Studio Express.
To build the database connection daemons, you need to install one or more of Oracle, MySQL, PostgreSQL, SQLite, unixODBC, iODBC, DB2, Firebird, Sybase or FreeTDS (for accessing either Sybase or MS SQL Server), MDB Tools for accessing MS Access Databases. Note that the database connection components are not supported natively under Windows though some do work under Cygwin.
You can download the most current source distribution of SQL Relay from sqlrelay.sourceforge.net.
For Linux, Unix or Cygwin installations, download the tar.gz file.
Extracting SQL RelayTo extract the source distribution, copy the file to a location on your machine that you have read/write access and execute the following commands:
gunzip sqlrelay-X.XX.tar.gz
tar xf sqlrelay-X.XX.tar
(Where X.XX is replaced with the version of SQL Relay that you downloaded.)
This will create a sqlrelay-X.XX directory.
Building SQL RelayTo build SQL Relay, change directories to the one that was created by the extraction, make sure your ORACLE_HOME environment variable is set if you want to include support for Oracle, and run:
configure
make
The configure script takes lots of command line options, most of which tell it where to find prerequisite software in case any of it is installed in non-standard locations. It also takes the --prefix option in case you want to install SQL Relay somewhere other than /usr/local/firstworks. For example:
configure --prefix=/usr/local
This invocation would cause the libraries to be installed in /usr/local/lib, the header files in /usr/local/include, the binaries and scripts to be installed in /usr/local/bin, etc.
There are also options for using cross-compilers and enabling debug and profiling. To see the full list of available options, run:
configure --help
Note that when using Cygwin, SQL Relay cannot be built against non-Cygwin dll's. You can't, for instance, build against the Oracle, Sybase, the native Windows version of MySQL or the native Windows versions of Perl, Python, PHP, etc. Many languages and a few databases come with Cygwin though and others can be compiled from source under Cygwin.
Also note, that when using Cygwin, you must use the Cygwin shell to build SQL Relay, rather than the Windows Command Line or DOS prompt.
Installing SQL RelayTo install SQL Relay become superuser and run:
make install
Libraries are installed in /usr/local/firstworks/lib. Include files are installed in /usr/local/firstworks/include. Binaries and scripts are installed in /usr/local/firstworks/bin. An example config file is installed in /usr/local/firstworks/etc. Java libraries are installed in /usr/local/firstworks/java. Files for other programming languages are installed in the appropriate language-specific directories.
If you install SQL Relay as root, init scripts and files will be installed in the appropriate places under /etc for your system. If you install SQL Relay as a non-root user, the init scripts and files will be installed in similar places under /usr/local/firstworks/etc.
To uninstall SQL Relay become superuser and run:
make uninstallInstalling SQL Relay RPMS
If your system supports RedHat Package Manager version 4.0.3 or greater then you can build RPMS by running the following command against the source distribution tarball:
rpm -ta sqlrelay-X.XX.tar.gz
(where X.XX is replaced with the version number)
You can instruct the build process not to build certain modules by giving it one of the following flags:
-without db2
-without freetds
-without firebird
-without mysql
-without odbc
-without oracle
-without postgresql
-without sqlite
-without sybase
-without mdbtools
-without perl
-without python
-without php
-without tcl
-without java
-without zope
For example, if you want to build everything but the oracle and zope modules, then you would run the following command:
rpm -ta -without oracle -without zope sqlrelay-X.XX.tar.gz
(where X.XX is replaced with the version number)
This will generate RPM's in the system-wide RPM directory (usually /usr/src/redhat/RPMS or /usr/local/rpm/RPMS) under the subdirectory corresponding to your system architecture. You can install them by changing directories into that directory and executing the following command as root:
rpm -i --nodeps sqlrelay-*
You can download the most current source distribution of SQL Relay from sqlrelay.sourceforge.net.
For native Windows installations, download the .zip file.
Extracting SQL RelayTo extract the source distribution, move the file to your desktop or a location on your machine that you have read/write access, right-click on the file and select "Extract All".
This will create a sqlrelay-X.XX folder.
(Where X.XX is replaced with the version of SQL Relay that you downloaded.)
Building and Installing SQL RelayThe native Windows build process for SQL Relay is currently somewhat primitive.
If you are running Windows Vista or higher, as a non-Administrator users, you must first create the folder C:\Program Files\Firstworks and give yourself full access permissions. This step is necessary if you are running as the Administrator or if you're running an older version of Windows.
Now, to build and install SQL Relay, open the Visual Studio Command Prompt and navigate to the base directory that was created when SQL Relay was extracted.
There should be a file named make.batch in that directory. Rename this file to make.bat. It is named with the .batch extension because various mail services don't allow .bat files to be emailed around, even if they are inside of an archive. To get around this, the file must manually be renamed. Now run:
make.bat
This should build and install SQL Relay. Various components will be installed under C:\Program Files\Firstworks. If SQL Relay is already installed there, the installation process will first remove it, then build it, then re-install it.
To run the command line programs, it is helpful to add C:\Program Files\Firstworks\bin to your PATH but not strictly necessary. Alternatively, you could just navigate to C:\Program Files\Firstworks\bin and run them from there.
If you need to uninstall everything, just trash the C:\Program Files\Firstworks folder. Note though that this will uninstall Rudiments as well.