How to build: Configure and make

If you've built other GNU projects, building FreeTDS is a fairly straightforward process. We have a terse and verbose description.

Note: FreeTDS is known to build with GNU and BSD make. If you encounter a large number of build errors, and your operating system's make is not GNU make (as is the case on most non-GNU/Linux systems), you may wish to install GNU make from ftp.gnu.org.

For Experts

$ ./configure --prefix=/usr/local/freetds
$ make
$ su root
Password: 
$ make install

For Everyone Else

The GNU development system can generate code for a wide variety of hardware architectures and operating systems, virtually all of which can run FreeTDS in consequence. The work of building and installing the FreeTDS libraries begins with the command configure, which generates the Makefile that governs how the code is compiled, linked, and installed. Once you've "configured" the project, make will manage the rest of the build.

The simplest form of running configure is:

	$ ./configure
and sometimes that's enough. configure accepts some command-line arguments, too, and you may need to provide some, depending on what your environment looks like.

There are a few optional arguments to configure that may be important to you.

./configure options

--prefix=PREFIX

install architecture-independent files in PREFIX

The default is /usr/local if this argument is not passed to configure. In versions prior to 0.60, the default was /usr/local/freetds.

--sysconfdir=DIR

read-only single-machine data in DIR

The default is PREFIX/etc (PREFIX being the value of --prefix=PREFIX, above) if this argument is not passed to configure. In versions prior to 0.60, the default was /usr/local/freetds/etc/.

--with-tdsver

Specifies the default TDS version. (There are a couple of ways to set the TDS version at run-time. This parameter takes effect if no run-time settings are provided.) Acceptable values are 4.2, 4.6, 5.0, 7.0, and 8.0.

The default is 5.0 if this argument is not passed to configure.

--with-iodbc

Build with ODBC support and to use the iODBC Driver Manager. (Requires iODBC to have already been installed.)

--with-unixodbc

Build with ODBC support and to use the unixODBC Driver Manager.(Requires unixODBC to have already been installed.)

--enable-msdblib

Enable Microsoft behavior in the db-lib API where it diverges from Sybase. (For instance, Microsoft uses different names for the members of its date structure.) Typically only needed for porting Win32 applications to Unix.

--enable-threadsafe

Force FreeTDS to use threadsafe versions of functions where available, such as using gethostbyname_r() instead of the older and non-safe gethostbyname(). Is not widely tested on all platform but has been tested on: Linux, FreeBSD, HP-UX 10.20 and should work on Solaris, Tru64, IRIX (reported to work). Is also a good idea to enable this switch if you configure Apache with multi-threading support. From 0.61 version this option is turned on by default in RPM building.

--enable-sybase-compat

Enable close compatibility with Sybase's ABI, at the expense of other features. Currently, this enables the generation of a dbopen() entry point in db-lib, which may clash with the DBM function with the same name. Absolutely not required for use with other free software.

--enable-extra-checks

This enable some extra check in FreeTDS code. Currently is not widely used and it should be used for debugging purpose.

--enable-developing

Enable some code still in developing. Should be used only by developer or brave users :)

Now you're ready to build. Follow these easy steps.

  1. Download the tarball and unpack it.

    Alternatively, get the latest build from CVS [1] .

  2. Change to the freetds directory.

  3. run ./configure with any options you need.

  4. make; make install; make clean

You normally need to be root to make install, unless you use the --prefix flag during configuration to install into your own directory.

With any luck, you've built and installed the FreeTDS libraries.

Notes

[1]

CVS users will need the GNU autotools: Autoconf, Automake, and libtool.