JezK
Edit File: config.html
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>How to build: Configure and make</title><link rel="stylesheet" type="text/css" href="userguide.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="FreeTDS User Guide" /><link rel="up" href="build.html" title="Chapter 2. Build FreeTDS" /><link rel="prev" href="packages.html" title="What to build: Packages, Tarballs, and the git repository" /><link rel="next" href="osissues.html" title="OS-specific Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">How to build: Configure and make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="packages.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Build <span class="productname">FreeTDS</span></th><td width="20%" align="right"> <a accesskey="n" href="osissues.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="config"></a>How to build: Configure and make</h2></div></div></div><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" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.gif" /></td><th align="left">Note</th></tr><tr><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 class="ulink" href="ftp://ftp.gnu.org/gnu/make/" target="_top">ftp.gnu.org</a>. </p></td></tr></table></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Experts"></a>For Experts</h3></div></div></div><pre class="screen"> <code class="prompt">$ </code><strong class="userinput"><code>./configure --prefix=/usr/local</code></strong> <code class="prompt">$ </code><strong class="userinput"><code>make</code></strong> <code class="prompt">$ </code><strong class="userinput"><code>su root</code></strong> <code class="prompt">Password: </code> <code class="prompt">$ </code><strong class="userinput"><code>make install</code></strong></pre><p>Building from git is described in the file <code class="filename">INSTALL.GIT.md</code>.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Everyone"></a>For Everyone Else </h3></div></div></div><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 <span class="command"><strong>configure</strong></span>, which generates the <code class="filename">Makefile</code> that governs how the code is compiled, linked, and installed. Once you've <span class="quote">“<span class="quote">configured</span>”</span> the project, <span class="command"><strong>make</strong></span> will manage the rest of the build.</p><div class="sidebar"><div class="titlepage"><div><div><p class="title"><strong>ODBC Preparation</strong></p></div></div></div><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>. <span class="command"><strong>configure</strong></span> will detect the the DM and use its header (<code class="filename">.h</code>) 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 <span class="command"><strong>configure</strong></span>.</p><p><span class="productname">FreeTDS</span> doesn't <span class="emphasis"><em>require</em></span> a DM. You can build the ODBC driver without one, as long as you have the requisite header files: <code class="filename">sql.h</code>, <code class="filename">sqlext.h</code> and <code class="filename">sqltypes.h</code>. These can be taken from either the <code class="systemitem">iODBC</code> or <code class="systemitem">unixODBC</code> distributions. Put them wherever you like (e.g., <code class="filename">/usr/local/include</code>). 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 <span class="command"><strong>configure</strong></span> what to do and where to look. Cf. <a class="link" href="config.html#withOdbcNoDM"><code class="option">--with-odbc-nodm</code></a>.</p></div><p>The simplest form of running <span class="command"><strong>configure</strong></span> is: </p><pre class="screen"> <code class="prompt">$ </code><strong class="userinput"><code>./configure</code></strong></pre><p> and sometimes that's enough. <span class="command"><strong>configure</strong></span> accepts command-line arguments, too, and you may need to provide some, depending on your environment.</p><p>There are a few optional arguments to <span class="command"><strong>configure</strong></span> that may be important to you. For a complete list, see <span class="command"><strong>configure --help</strong></span>.</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Configure.Options"></a><span class="command"><strong>configure</strong></span> options</h4></div></div></div><div class="variablelist"><a id="tab.configure.Directories"></a><p class="title"><strong>Directories and TDS version</strong></p><dl class="variablelist"><dt><span class="term"><code class="option">--prefix=<em class="replaceable"><code>PREFIX</code></em> </code></span></dt><dd><p> install architecture-independent files in <em class="parameter"><code>PREFIX</code></em>. When you run <span class="command"><strong>make install</strong></span>, libraries will be placed in <em class="parameter"><code>PREFIX</code></em><code class="filename">/lib</code>, executables in <em class="parameter"><code>PREFIX</code></em><code class="filename">/bin</code>, and so on.</p><p>The default is <code class="filename">/usr/local</code> if this argument is not passed to <span class="command"><strong>configure</strong></span>.</p></dd><dt><span class="term"><code class="option">--sysconfdir=<em class="replaceable"><code>DIR</code></em> </code></span></dt><dd><p> read-only single-machine data in <em class="parameter"><code>DIR</code></em></p><p>The default is <em class="replaceable"><code>PREFIX/etc</code></em> (<em class="parameter"><code>PREFIX</code></em> being the value of <code class="option">--prefix=<em class="replaceable"><code>PREFIX</code></em></code>, above) if this argument is not passed to <span class="command"><strong>configure</strong></span>.</p></dd><dt><span class="term"><code class="option">--with-libiconv-prefix=<em class="replaceable"><code>DIR</code></em> </code></span></dt><dd><p>Specifies the location of the iconv library to use. <span class="command"><strong>configure</strong></span> 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><p>Version 0.95 removed support for iconv which cannot convert from any encoding to any encoding. This affect potentially systems like Tru64 and HP-UX were iconv mainly convert from/to ucs2. It's recommended to use GNU libiconv in this case.</p></dd><dt><span class="term"><code class="option">--with-tdsver=<em class="replaceable"><code>VER</code></em> </code></span></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 <em class="parameter"><code>VER</code></em> are <code class="literal">5.0</code>, <code class="literal">7.1</code>, <code class="literal">7.2</code>, <code class="literal">7.3</code> and <code class="literal">7.4</code>.</p><p>The default is <code class="literal">auto</code> if this argument is not passed to <span class="command"><strong>configure</strong></span>.</p></dd></dl></div><div class="variablelist"><a id="tab.ODBC.Driver.Managers"></a><p class="title"><strong>ODBC Driver Managers</strong></p><dl class="variablelist"><dt><span class="term"><code class="option">--with-iodbc </code>, </span><span class="term"><code class="option">--with-iodbc=<em class="replaceable"><code>DIR</code></em> </code>, </span><span class="term"><code class="option">--with-unixodbc=<em class="replaceable"><code>DIR</code></em> </code></span></dt><dd><p> Specify a particular ODBC driver manager and the directory in which it is installed. The <code class="option">--with-iodbc</code> form chooses <code class="systemitem">iODBC</code> as the driver manager, and <code class="option">--with-unixodbc</code> specifies <code class="systemitem">unixODBC</code> as the driver manager. The directory argument is required for <code class="option">--with-unixodbc</code>, but may be omitted for <code class="option">--with-iodbc</code>; pkg-config will be used to find your <code class="systemitem">iODBC</code> installation if the directory is omitted. Typical directory arguments are <code class="filename">/usr</code> and <code class="filename">/usr/local</code>. </p><p> So long as either <code class="systemitem">iODBC</code> or <code class="systemitem">unixODBC</code> are installed, the build system will detect your driver manager by default. As a result, these options are only needed if you wish to override the default behavior. </p><p> It is an error to specify both <code class="option">--with-iodbc</code> and <code class="option">--with-unixodbc</code>. </p></dd><dt><a id="withOdbcNoDM"></a><span class="term"><code class="option">--with-odbc-nodm=<em class="replaceable"><code>DIR</code></em> </code></span></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 <code class="filename">.h</code> files. <span class="command"><strong>configure</strong></span> will not cause the ODBC driver to be built unless this option is used or a DM is detected/specified.</p></dd></dl></div><div class="variablelist"><a id="tab.turn.off"></a><p class="title"><strong>Things you can turn off</strong></p><dl class="variablelist"><dt><span class="term"><code class="option">--disable-odbc </code></span></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><span class="term"><code class="option">--disable-apps </code></span></dt><dd><p>Do not attempt to build applications like tsql.</p></dd><dt><span class="term"><code class="option">--disable-server </code></span></dt><dd><p>Do not attempt to build server stuff.</p></dd><dt><span class="term"><code class="option">--disable-pool </code></span></dt><dd><p>Do not attempt to build pool stuff.</p></dd><dt><span class="term"><code class="option">--disable-libiconv</code></span></dt><dd><p>By default, <span class="command"><strong>configure</strong></span> will search your system for an <code class="systemitem">iconv</code> library for use with Microsoft servers (because TDS 7.0 employs Unicode). This switch prevents that search. If no <code class="systemitem">iconv</code> 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><span class="term"><code class="option">--disable-threadsafe</code></span></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>. <span class="command"><strong>configure</strong></span> 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, HP-UX and Windows. It should work on Solaris, Tru64, and (reportedly) IRIX. Not expected to work on non-unixy systems. Should not be used if your system supports threads. Pool server and MARS won't work if disabled.</p></dd><dt><span class="term"><code class="option">--disable-debug</code></span></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><dt><span class="term"><code class="option">--disable-odbc-wide</code></span></dt><dd><p>Disable support for wide characaters in ODBC. </p></dd><dt><span class="term"><code class="option">--disable-sspi</code></span></dt><dd><p>Disable SSPI support. SSPI is a Micrsoft library that allows you to use your current logged-in account for authentication. With this option enabled (the default), <span class="productname">FreeTDS</span> supports "trusted logins" for Win32/64, just as Microsoft's own implementations do. </p></dd></dl></div><div class="variablelist"><a id="tab.turnon"></a><p class="title"><strong>Things you can turn on</strong></p><dl class="variablelist"><dt><span class="term"><code class="option">--enable-msdblib</code></span></dt><dd><p>Enable Microsoft behavior in the <code class="systemitem">DB-Library</code> <acronym class="acronym">API</acronym> where it diverges from Sybase's. Use this option if you are replacing Microsoft's libraries with <span class="productname">FreeTDS</span></p><p>This option specifies default behavior. Programs can change the default at compile time by defining MSDBLIB or SYBDBLIB (for Microsoft or Sybase behavior, respectively).</p></dd><dt><span class="term"><code class="option">--enable-sybase-compat</code></span></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 <code class="systemitem">DB-Library</code>, which may clash with the <code class="systemitem">DBM</code> function with the same name. Absolutely <span class="emphasis"><em>not required</em></span> for use with other free software.</p></dd><dt><span class="term"><code class="option">--enable-krb5</code></span></dt><dd><p>Enable Kerberos support. With Kerberos you can connect to server using your stored Kerberos ticket. Obviously requires Kerberos be configured on the machine. </p></dd><dt><span class="term"><code class="option">--enable-extra-checks</code></span></dt><dd><p>Intended for debugging purposes, enables certain internal consistency checks against problems like memory corruption and buffer exhaustion. </p></dd><dt><span class="term"><code class="option">--enable-developing</code></span></dt><dd><p>Enable some code still in development. Should be used only by a developer or a brave user :) </p></dd><dt><span class="term"><code class="option">--enable-odbc-wide-tests</code></span></dt><dd><p>Compile ODBC tests to use wide characters. Test will use wide versions. </p></dd></dl></div><div class="variablelist"><a id="tab.ssl"></a><p class="title"><strong>SSL support</strong></p><dl class="variablelist"><dt><span class="term"><code class="option">--with-gnutls</code></span></dt><dd><p>Enable SSL using GnuTLS.</p></dd><dt><span class="term"><code class="option">--with-openssl=<em class="replaceable"><code>DIR</code></em></code></span></dt><dd><p>Enable SSL using OpenSSL. Unlike <span class="productname">FreeTDS</span>, OpenSSL does not use the LGPL. Please read the <a class="ulink" 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"><div class="titlepage"><div><div><h4 class="title"><a id="idm686"></a><span class="command"><strong>Make</strong></span></h4></div></div></div><p>Now you're ready to build. Follow these easy steps.</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Download the tarball and unpack it.</p><p>Alternatively, get the latest build from <span class="productname">git</span> <a href="#ftn.idm695" class="footnote" id="idm695"><sup class="footnote">[5]</sup></a> . </p></li><li class="listitem"><p>Change to the <code class="filename">freetds</code> directory. </p></li><li class="listitem"><p>run <span class="command"><strong>./configure</strong></span> with any options you need. </p></li><li class="listitem"><p><span class="command"><strong>make; make install; make clean</strong></span> </p></li></ol></div><p>You normally need to be root to <span class="command"><strong>make install</strong></span>, 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 class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Two bits of advice, if you like to keep things tidy and keep track of what you did. "><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../images/tip.gif" /></td><th align="left">Two bits of advice, if you like to keep things tidy and keep track of what you did. </th></tr><tr><td align="left" valign="top"><p>Create a file to hold your configure options called, say, <code class="filename">.build_options</code>.</p><p>Create a build directory for the binaries, and invoke <span class="command"><strong>../configure $(cat ../.build_options)</strong></span>. </p><p>This approach lets you remove the binaries at any time and rebuild from scratch using the same options.</p></td></tr></table></div></div></div><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div id="ftn.idm695" class="footnote"><p><a href="#idm695" class="para"><sup class="para">[5] </sup></a><span class="productname">git</span> users will need the GNU autotools: Autoconf, Automake, and libtool.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="packages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="build.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="osissues.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">What to build: Packages, Tarballs, and the <span class="productname">git</span> repository </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> OS-specific Issues</td></tr></table></div></body></html>