<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >How to build: Configure and make</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="FreeTDS User Guide" HREF="index.htm"><LINK REL="UP" TITLE="Build FreeTDS" HREF="build.htm"><LINK REL="PREVIOUS" TITLE="What to build: Packages, Tarballs, and the CVS repository" HREF="packages.htm"><LINK REL="NEXT" TITLE="OS-specific Issues" HREF="osissues.htm"><LINK REL="STYLESHEET" TYPE="text/css" HREF="userguide.css"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" ><SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > User Guide: A Guide to Installing, Configuring, and Running <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN ></TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="packages.htm" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 2. Build <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="osissues.htm" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="CONFIG" >How to build: Configure and make</A ></H1 ><P >If you've built other <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > projects, building <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > is a fairly straightforward process. We have a terse and verbose description. </P ><DIV CLASS="NOTE" ><P ></P ><TABLE CLASS="NOTE" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="../images/note.gif" HSPACE="5" ALT="Note"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P ><SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > is known to build with <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > and <ACRONYM CLASS="ACRONYM" >BSD</ACRONYM > <SPAN CLASS="APPLICATION" >make</SPAN >. If you encounter a large number of build errors, and your operating system's <SPAN CLASS="APPLICATION" >make</SPAN > is not <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > <SPAN CLASS="APPLICATION" >make</SPAN > (as is the case on most non-<ACRONYM CLASS="ACRONYM" >GNU</ACRONYM >/Linux systems), you may wish to install <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > <SPAN CLASS="APPLICATION" >make</SPAN > from <A HREF="ftp://ftp.gnu.org/gnu/make/" TARGET="_top" >ftp.gnu.org</A >. </P ></TD ></TR ></TABLE ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="EXPERTS" >For Experts</A ></H2 ><PRE CLASS="SCREEN" ><SAMP CLASS="PROMPT" >$ </SAMP ><KBD CLASS="USERINPUT" >./configure --prefix=/usr/local/freetds</KBD > <SAMP CLASS="PROMPT" >$ </SAMP ><KBD CLASS="USERINPUT" >make</KBD > <SAMP CLASS="PROMPT" >$ </SAMP ><KBD CLASS="USERINPUT" >su root</KBD > <SAMP CLASS="PROMPT" >Password: </SAMP > <SAMP CLASS="PROMPT" >$ </SAMP ><KBD CLASS="USERINPUT" >make install</KBD ></PRE ><P >Building from CVS is described in the file INSTALL.CVS. </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="EVERYONE" >For Everyone Else</A ></H2 ><P > The <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > development system can generate code for a wide variety of hardware architectures and operating systems, virtually all of which can run <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > in consequence. The work of building and installing the <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > libraries begins with the command <B CLASS="COMMAND" >configure</B >, which generates the <TT CLASS="FILENAME" >Makefile</TT > that governs how the code is compiled, linked, and installed. Once you've <SPAN CLASS="QUOTE" >"configured"</SPAN > the project, <B CLASS="COMMAND" >make</B > will manage the rest of the build. </P ><TABLE CLASS="SIDEBAR" BORDER="1" CELLPADDING="5" ><TR ><TD ><DIV CLASS="SIDEBAR" ><A NAME="AEN397" ></A ><P ><B >ODBC Preparation</B ></P ><P >If you intend to build the <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > ODBC driver — and want to use a Driver Manager (DM), as most people do — install the Driver Manager before configuring <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN >. <B CLASS="COMMAND" >configure</B > will detect the the DM and use its header (<TT CLASS="FILENAME" >.h</TT >) files for ODBC constants and such. If your DM is installed in an unusual directory, you may have to provide the directory name as a parameter to <B CLASS="COMMAND" >configure</B >.</P ><P ><SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > doesn't <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >require</I ></SPAN > a DM. You can build the ODBC driver without one, as long as you have the requisite header files: <TT CLASS="FILENAME" >sql.h</TT >, <TT CLASS="FILENAME" >sqlext.h</TT > and <TT CLASS="FILENAME" >sqltypes.h</TT >. These can be taken from either the iODBC or UnixODBC distributions. Put them wherever you like (e.g., <TT CLASS="FILENAME" >/usr/local/include</TT >). Because <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > won't detect your (missing) DM, it won't automatically build the ODBC driver, so you'll have to tell <B CLASS="COMMAND" >configure</B > what to do and where to look. Cf. <A HREF="config.htm#WITHODBCNODM" ><CODE CLASS="OPTION" >--with-odbc-nodm</CODE ></A > <CODE CLASS="OPTION" ></CODE >.</P ></DIV ></TD ></TR ></TABLE ><P >The simplest form of running <B CLASS="COMMAND" >configure</B > is: <PRE CLASS="SCREEN" > <SAMP CLASS="PROMPT" >$ </SAMP ><KBD CLASS="USERINPUT" >./configure</KBD ></PRE > and sometimes that's enough. <B CLASS="COMMAND" >configure</B > accepts some command-line arguments, too, and you may need to provide some, depending on what your environment looks like. </P ><P >There are a few optional arguments to <B CLASS="COMMAND" >configure</B > that may be important to you. For a complete list, see <B CLASS="COMMAND" >configure --help</B >. </P ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN426" ><B CLASS="COMMAND" >configure</B > options</A ></H3 ><P ></P ><DIV CLASS="VARIABLELIST" ><P ><B >Directories and TDS version</B ></P ><DL ><DT ><CODE CLASS="OPTION" >--prefix=<TT CLASS="REPLACEABLE" ><I >PREFIX</I ></TT > </CODE ></DT ><DD ><P > install architecture-independent files in <CODE CLASS="PARAMETER" >PREFIX</CODE >. When you run <B CLASS="COMMAND" >make install</B >, libraries will be placed in <CODE CLASS="PARAMETER" >PREFIX</CODE ><TT CLASS="FILENAME" >/lib</TT >, executables in <CODE CLASS="PARAMETER" >PREFIX</CODE ><TT CLASS="FILENAME" >/bin</TT >, and so on. </P ><P >The default is <TT CLASS="FILENAME" >/usr/local</TT > if this argument is not passed to <B CLASS="COMMAND" >configure</B >. </P ></DD ><DT ><CODE CLASS="OPTION" >--sysconfdir=<TT CLASS="REPLACEABLE" ><I >DIR</I ></TT > </CODE ></DT ><DD ><P > read-only single-machine data in <CODE CLASS="PARAMETER" >DIR</CODE > </P ><P >The default is <TT CLASS="REPLACEABLE" ><I >PREFIX/etc</I ></TT > (<CODE CLASS="PARAMETER" >PREFIX</CODE > being the value of <CODE CLASS="OPTION" >--prefix=<TT CLASS="REPLACEABLE" ><I >PREFIX</I ></TT ></CODE >, above) if this argument is not passed to <B CLASS="COMMAND" >configure</B >. </P ></DD ><DT ><CODE CLASS="OPTION" >--with-libiconv-prefix=<TT CLASS="REPLACEABLE" ><I >DIR</I ></TT > </CODE ></DT ><DD ><P >Specifies the location of the iconv library to use. <B CLASS="COMMAND" >configure</B > will search for libiconv in the usual places; use <CODE CLASS="OPTION" >--with-libiconv-prefix</CODE > if it's unsuccessful (assuming you want to use iconv, of course). Overridden by <CODE CLASS="OPTION" >--disable-libiconv</CODE >, below. </P ></DD ><DT ><A NAME="WITHODBCNODM" ></A ><CODE CLASS="OPTION" >--with-odbc-nodm=<TT CLASS="REPLACEABLE" ><I >DIR</I ></TT > </CODE ></DT ><DD ><P >If you're building the ODBC driver and not using a Driver Manager, use this option to indicate the location of the <TT CLASS="FILENAME" >.h</TT > files. <B CLASS="COMMAND" >configure</B > will not cause the ODBC driver to be built unless this option is used or a DM is detected/specified. </P ></DD ><DT ><CODE CLASS="OPTION" >--with-tdsver=<TT CLASS="REPLACEABLE" ><I >VER</I ></TT > </CODE ></DT ><DD ><P >Specifies the default <ACRONYM CLASS="ACRONYM" >TDS</ACRONYM > version. (There are a couple of ways to set the <ACRONYM CLASS="ACRONYM" >TDS</ACRONYM > version at run-time. This parameter takes effect if no run-time settings are provided.) Acceptable values of <CODE CLASS="PARAMETER" >VER</CODE > are <TT CLASS="LITERAL" >4.2</TT >, <TT CLASS="LITERAL" >4.6</TT >, <TT CLASS="LITERAL" >5.0</TT >, <TT CLASS="LITERAL" >7.0</TT >, and <TT CLASS="LITERAL" >8.0</TT >.</P ><P >The default is <TT CLASS="LITERAL" >5.0</TT > if this argument is not passed to <B CLASS="COMMAND" >configure</B >.</P ></DD ></DL ></DIV ><P ></P ><DIV CLASS="VARIABLELIST" ><P ><B >ODBC Driver Managers</B ></P ><DL ><DT ><CODE CLASS="OPTION" >--with-iodbc=<TT CLASS="REPLACEABLE" ><I >DIR</I ></TT > </CODE >, <CODE CLASS="OPTION" >--with-unixodbc=<TT CLASS="REPLACEABLE" ><I >DIR</I ></TT > </CODE ></DT ><DD ><P >Specify directory of <SPAN CLASS="SYSTEMITEM" >iODBC</SPAN > or <SPAN CLASS="SYSTEMITEM" >unixODBC</SPAN > support, and use it as the Driver Manager. As of version 0.62, the ODBC Driver Manager is detected by <B CLASS="COMMAND" >configure</B >, so use this parameter only if yours is installed in a nonstandard path. (Requires <SPAN CLASS="PRODUCTNAME" >iODBC</SPAN > or <SPAN CLASS="SYSTEMITEM" >unixODBC</SPAN > to have already been installed.)</P ></DD ></DL ></DIV ><P ></P ><DIV CLASS="VARIABLELIST" ><P ><B >Things you can turn off</B ></P ><DL ><DT ><CODE CLASS="OPTION" >--disable-odbc </CODE ></DT ><DD ><P >Do not attempt to detect ODBC, and do not build the ODBC driver. In case you don't care about ODBC. </P ></DD ><DT ><CODE CLASS="OPTION" >--disable-libiconv</CODE ></DT ><DD ><P >By default, <B CLASS="COMMAND" >configure</B > will search your system for an <SPAN CLASS="SYSTEMITEM" >iconv</SPAN > library for use with Microsoft servers (because TDS 7.0 employs Unicode). This switch prevents that search. If no <SPAN CLASS="SYSTEMITEM" >iconv</SPAN > library is used, <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > relies on its built-in iconv emulation, which is capable of converting ISO-8859-1 to UCS-2, sufficient for many applications. </P ></DD ><DT ><CODE CLASS="OPTION" >--disable-threadsafe</CODE ></DT ><DD ><P >Force <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > not to use threadsafe versions of functions such as <CODE CLASS="FUNCTION" >gethostbyname_r()</CODE > where available. Rely instead on the older and non-threadsafe ones such as <CODE CLASS="FUNCTION" >gethostbyname()</CODE >. <B CLASS="COMMAND" >configure</B > tests some of these functions. If the tests are successful, <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > will use threadsafe functions throughout. </P ><P >Threadsafe operation has been tested on Linux, FreeBSD, and HP-UX. It should work on Solaris, Tru64, and (reportedly) IRIX. Not expected to work on non-unixy systems. It is a good idea to enable threadsafe operation if you configure Apache with multi-threading support.</P ></DD ><DT ><CODE CLASS="OPTION" >--disable-debug</CODE ></DT ><DD ><P >Debug-mode compiles are enabled by default, and will remain so at least until version 1.0. You can speed things up ever so slightly by disabling it. </P ></DD ></DL ></DIV ><P ></P ><DIV CLASS="VARIABLELIST" ><P ><B >Things you can turn on</B ></P ><DL ><DT ><CODE CLASS="OPTION" >--enable-msdblib</CODE ></DT ><DD ><P >Enable Microsoft behavior in the <SPAN CLASS="SYSTEMITEM" >db-lib</SPAN > <ACRONYM CLASS="ACRONYM" >API</ACRONYM > where it diverges from Sybase's. (For instance, Microsoft uses different names for the members of its date structure.) Typically needed only for porting Win32 applications to Unix.</P ><P >As of version 0.63, this option specifies just the default behavior. Programs can change the default at compile time by defining MSDBLIB or SYBDBLIB (for Microsoft or Sybase behavior, respectively) .</P ></DD ><DT ><CODE CLASS="OPTION" >--enable-sybase-compat</CODE ></DT ><DD ><P >Enable close compatibility with Sybase's ABI, at the expense of other features. Currently, this enables the generation of a dbopen() entry point in <SPAN CLASS="SYSTEMITEM" >db-lib</SPAN >, which may clash with the <SPAN CLASS="SYSTEMITEM" >DBM</SPAN > function with the same name. Absolutely <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >not required</I ></SPAN > for use with other free software. </P ></DD ><DT ><CODE CLASS="OPTION" >--enable-extra-checks</CODE ></DT ><DD ><P >Intended for debugging purposes, enables certain internal consistency checks against problems like memory corruption and buffer exhaustion. </P ></DD ><DT ><CODE CLASS="OPTION" >--enable-developing</CODE ></DT ><DD ><P >Enable some code still in development. Should be used only by a developer or a brave user :) </P ></DD ></DL ></DIV ><P ></P ><DIV CLASS="VARIABLELIST" ><P ><B >SSL support</B ></P ><DL ><DT ><CODE CLASS="OPTION" >--with-gnutls</CODE ></DT ><DD ><P >Enable SSL using GnuTLS. Use version 1.2.3 or newer.</P ></DD ><DT ><CODE CLASS="OPTION" >--with-openssl=<TT CLASS="REPLACEABLE" ><I >DIR</I ></TT ></CODE ></DT ><DD ><P >Enable SSL using OpenSSL. Unlike <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN >, OpenSSL does not use the LGPL. Please read the <A HREF="http://www.openssl.org/source/license.html" TARGET="_top" >OpenSSL license</A > before distributing binaries compiled with this option. </P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN584" ><B CLASS="COMMAND" >Make</B ></A ></H3 ><P >Now you're ready to build. Follow these easy steps. </P ><P ></P ><OL TYPE="1" ><LI ><P >Download the tarball and unpack it.</P ><P >Alternatively, get the latest build from <SPAN CLASS="PRODUCTNAME" >CVS</SPAN > <A NAME="AEN593" HREF="#FTN.AEN593" ><SPAN CLASS="footnote" >[1]</SPAN ></A > . </P ></LI ><LI ><P >Change to the <TT CLASS="FILENAME" >freetds</TT > directory. </P ></LI ><LI ><P >run <B CLASS="COMMAND" >./configure</B > with any options you need. </P ></LI ><LI ><P ><B CLASS="COMMAND" >make; make install; make clean</B > </P ></LI ></OL ><P >You normally need to be root to <B CLASS="COMMAND" >make install</B >, unless you used the <CODE CLASS="OPTION" >--prefix</CODE > option during configuration to install into your own directory. </P ><P >With any luck, you've built and installed the <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > libraries. </P ></DIV ></DIV ></DIV ><H3 CLASS="FOOTNOTES" >Notes</H3 ><TABLE BORDER="0" CLASS="FOOTNOTES" WIDTH="100%" ><TR ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="5%" ><A NAME="FTN.AEN593" HREF="config.htm#AEN593" ><SPAN CLASS="footnote" >[1]</SPAN ></A ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="95%" ><P ><SPAN CLASS="PRODUCTNAME" >CVS</SPAN > users will need the GNU autotools: Autoconf, Automake, and libtool. </P ></TD ></TR ></TABLE ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="packages.htm" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.htm" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="osissues.htm" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >What to build: Packages, Tarballs, and the <SPAN CLASS="PRODUCTNAME" >CVS</SPAN > repository</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="build.htm" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >OS-specific Issues</TD ></TR ></TABLE ></DIV ></BODY ></HTML >