README.vms -- VMS-specific notes on building and running FreeTDS

FreeTDS has successfully built and passed all expected tests on all supported
versions of OpenVMS, which as of this writing are OpenVMS Alpha (8.4+), OpenVMS
I64 (8.4+), and OpenVMS x86 (9.2+). In not too distant memory it has built and
run on most versions of OpenVMS 7.0 and later with DEC/Compaq C 6.0 or later.

Other prerequisites:

    gunzip
    vmstar
    MMS or MMK

Build Instructions

Decompress and unpack the source archive onto an ODS-5 disk using gunzip and
vmstar or other tar utility. Make sure extended parse is enabled in your
process (SET PROCESS/PARSE=EXTENDED) and that the feature logical name
DECC$EFS_CHARSET is enabled; these settings (and the ODS-5 disk) are not
required to run FreeTDS, but they are necessary for the build and test suite to
find there requisite parts.  Set default to the top-level source directory and
run the configuration script like so:

    $ @[.vms]configure

This creates a descrip.mms in the top-level source directory which you may
execute by simply running MMS (if you have the Module Management System that
is part of DECset) or MMK (a freeware MMS alternative available from
https://github.com/endlesssoftware/mmk).  You may change some default behaviors
by sypplying one or more of the following macros to the make utility:

TDSVER

FreeTDS usuually negotiates with the server to find a reasonable version of the
TDS protocol, but you may optionally give it a default using this macro, which
expects a value that will be passed directly to the C compiler.  Valid values
are TDS50, TDS71, TDS72, TDS73 and TDS74.  Consult the [.doc] directory for more
information about the TDS protocol, what servers use which versions, and the
history of the versions.

Example:

    $ MMK/MACRO="TDSVER"="TDS71"


MSDBLIB

Enables Microsoft behavior in the db-lib API where it diverges from
Sybase's.  See additional documentation in the [.doc] directory.

Example:

    $ MMK/MACRO="MSDBLIB"=1


ODBC

By default the build does not include ODBC support; this macro instructs the
build to include it.  At the moment, the unixODBC driver manager is assumed
(see http://www.unixodbc.org), but others may work as well.

The following logical names must be defined in order to build with ODBC
support:

    ODBC_LIBDIR		directory containing driver manager's libraries
    ODBC_INCDIR		directory containing driver manager's include files
    LIBODBC		the shareable image comprising the driver manager

Note:  in unixODBC 2.2.4 and later, all of these logicals except
ODBC_INCDIR will be set up by running ODBC_SETUP.COM in the library
directory.

Examples:

    $ MMS/MACRO="ODBC"=1
    $ MMK/MACRO=("ODBC"=1,"TDSVER"="TDS71")

__DEBUG__

Instructs the build to target the OpenVMS debugger and produce compiler listings
and linker maps.

Example:

    $ MMK/MACRO=__DEBUG__=1

Caveats and To-do:

It's probably best to define the locations of your configuration files as
logical names; otherwise FreeTDS may concoct an unparseable combination of
UNIX and VMS filename syntax.  For example:

    $ DEFINE FREETDSCONF DISK$USER:[TDSDIR]freetds.conf

There is currently no install target; it's up to you to put the libraries,
include files, etc. wherever you want them.

A VAX port is within the realm of possibilities.  It would need to convert
between IEEE floating point data and native format and/or request native
F_FLOAT and D_FLOAT from the server (which may only work on Sybase, not MS
SQL Server, but that's TBD).

As more ODBC functions are implemented, the file [.vms]odbc_driver_axp.opt
needs to be updated to point to the real functions instead of the aliases to
the stub for unimplemented functions.

The build currently compiles with the /NAMES=AS_IS switch when the ODBC
macro is enabled; this results in mixed-case symbol names.  Mixed-case
symbols were necessary to get the code working with unixODBC but may cause
problems when calling the FreeTDS libraries from other languages.  There
are a variety of approaches that could be taken to work around this but for
now you'll have to roll your own.


Last updated: 	28-JUN-2025	Craig A. Berry	<craigberry@mac.com>
