Compiling Software From Source

download Compiling Software From Source

of 3

Transcript of Compiling Software From Source

  • 7/26/2019 Compiling Software From Source

    1/3

    FreeTDS User Guide: A Guide to Installing, Configuring, and Running FreeTDSPrev Chapter 2. Build FreeTDS Next

    How to build: Configure and make

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

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

    For Experts

    $ ./configure --prefix=/usr/local$ make$ su rootPassword:$ make install

    Building from CVS is described in the file INSTALL.CVS.

    For Everyone Else

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

    ODBC Preparation

    If you intend to build the FreeTDS ODBC driver and want to use a Driver Manager (DM), as most people do install the Driver Manager before configuring FreeTDS. configurewill detect the the DM and use its header (.h)files for ODBC constants and such. If your DM is installed in an unusual directory, you may have to provide thedirectory name as a parameter to configure.

    FreeTDS doesn't requirea DM. You can build the ODBC driver without one, as long as you have the requisiteheader files: sql.h, sqlext.hand sqltypes.h. These can be taken from either the iODBC or UnixODBC distributions.Put them wherever you like (e.g., /usr/local/include). Because FreeTDS won't detect your (missing) DM, it won'tautomatically build the ODBC driver, so you'll have to tell configurewhat to do and where to look. Cf. --with-odbc-nodm.

    The simplest form of running configureis:

    $ ./configure

    and sometimes that's enough. configureaccepts command-line arguments, too, and you may need to providesome, depending on your environment.

    There are a few optional arguments to configurethat may be important to you. For a complete list, see configure--help.

    configure options

    Directories and TDS version

    --prefix=PREFIX

    install architecture-independent files in PREFIX. When you run make install, libraries will be placed inPREFIX/lib, executables in PREFIX/bin, and so on.

    The default is /usr/localif this argument is not passed to configure.

    --sysconfdir=DIR

    read-only single-machine data in DIR

    The default is PREFIX/etc(PREFIXbeing the value of --prefix=PREFIX, above) if this argument is not passed toconfigure.

    --with-libiconv-prefix=DIR

    Specifies the location of the iconv library to use. configurewill search for libiconv in the usual places; use--with-libiconv-prefixif it's unsuccessful (assuming you want to use iconv, of course). Overridden by --disable-libiconv, below.

    --with-tdsver=VER

    How to build: Configure and make http://www.freetds.org/userguide/config.htm

    1 of 3 01/02/2014 11:21 AM

  • 7/26/2019 Compiling Software From Source

    2/3

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

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

    ODBC Driver Managers

    --with-iodbc=DIR , --with-unixodbc=DIR

    Specify directory of iODBC or unixODBC support, and use it as the Driver Manager. As of version 0.62, theODBC Driver Manager is detected by configure, so use this parameter only if yours is installed in anonstandard path. (Requires iODBC or unixODBC to have already been installed.)

    --with-odbc-nodm=DIR

    If you're building the ODBC driver and not using a Driver Manager, use this option to indicate the location ofthe .hfiles. configurewill not cause the ODBC driver to be built unless this option is used or a DM isdetected/specified.

    Things you can turn off

    --disable-odbc

    Do not attempt to detect ODBC, and do not build the ODBC driver. In case you don't care about ODBC.

    --disable-apps

    Do not attempt to build applications like tsql.

    --disable-server

    Do not attempt to build server stuff.

    --disable-pool

    Do not attempt to build pool stuff.

    --disable-libiconv

    By default, configurewill search your system for an iconv library for use with Microsoft servers (because TDS7.0 employs Unicode). This switch prevents that search. If no iconv library is used, FreeTDS relies on itsbuilt-in iconv emulation, which is capable of converting ISO-8859-1 to UCS-2, sufficient for many applications.

    --disable-threadsafe

    Force FreeTDS not to use threadsafe versions of functions such as gethostbyname_r()where available. Relyinstead on the older and non-threadsafe ones such as gethostbyname(). configuretests some of these functions.If the tests are successful, FreeTDS will use threadsafe functions throughout.

    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 operationif you configure Apache with multi-threading support.

    --disable-debug

    Debug-mode compiles are enabled by default, and will remain so at least until version 1.0. You can speedthings up ever so slightly by disabling it.

    Things you can turn on

    --enable-msdblib

    Enable Microsoft behavior in the DB-Library API where it diverges from Sybase's. Use this option if you arereplacing Microsoft's libraries with FreeTDS

    This option specifies default behavior. Programs can change the default at compile time by defining MSDBLIBor SYBDBLIB (for Microsoft or Sybase behavior, respectively).

    --enable-sybase-compat

    Enable close compatibility with Sybase's ABI, at the expense of other features. Currently, this enables thegeneration of a dbopen() entry point in DB-Library, which may clash with the DBM function with the samename. Absolutely not requiredfor use with other free software.

    --enable-krb5

    Enable Kerberos support. With Kerberos you can connect to server using your stored Kerberos ticket.Obviously requires Kerberos be configured on the machine.

    --enable-sspi

    Enable SSPI support. SSPI is a Micrsoft library that allows you to use your current logged-in account forauthentication. With this option enabled, FreeTDS supports "trusted logins" for Win32/64, just as Microsoft'sown implementations do.

    How to build: Configure and make http://www.freetds.org/userguide/config.htm

    2 of 3 01/02/2014 11:21 AM

  • 7/26/2019 Compiling Software From Source

    3/3

    --enable-extra-checks

    Intended for debugging purposes, enables certain internal consistency checks against problems like memorycorruption and buffer exhaustion.

    --enable-developing

    Enable some code still in development. Should be used only by a developer or a brave user :)

    SSL support

    --with-gnutls

    Enable SSL using GnuTLS. Use version 1.2.3 or newer.

    --with-openssl=DIR

    Enable SSL using OpenSSL. Unlike FreeTDS, OpenSSL does not use the LGPL. Please read the OpenSSLlicensebefore distributing binaries compiled with this option.

    Make

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

    Download the tarball and unpack it.

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

    1.

    Change to the freetdsdirectory.2.

    run ./configurewith any options you need.3.

    make; make install; make clean4.

    You normally need to be root to make install, unless you used the --prefixoption during configuration to installinto your own directory.

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

    Two bits of advice, if you like to keep things tidy and keep track of what you did.

    Create a file to hold your configure options called, say, .build_options.

    Create a build directory for the binaries, and invoke ../configure $(cat ../.build_options).

    This approach lets you remove the binaries at any time and rebuild from scratch using the same options.

    Notes

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

    Prev Home NextWhat to build: Packages, Tarballs, andthe CVS repository

    Up OS-specific Issues

    How to build: Configure and make http://www.freetds.org/userguide/config.htm

    3 of 3 01/02/2014 11:21 AM