[freetds] Notes on buiding for VMS from CVS sources

Richard Banks rbanks at arel.com.au
Mon May 16 01:55:55 EDT 2005


Hi,

I don't know if anyone has built the system on VMS lately, so I just 
thought I'd post a few notes about my experience building for VMS using 
the latest code from the CVS tree (16-May-05).

I'm building for TDS 8.0, MSSQL, without ODBC support.
cc/version = Compaq C V6.5-001 on OpenVMS Alpha V7.2-1
ucx show version = DIGITAL TCP/IP Services for OpenVMS Alpha Version 
V5.0A - ECO 3

1.  The @[.VMS]CONFIGURE.COM file requires the presence of the 
[]CONFIGURE. file (built from autoconf and included in the nightly 
snapshot).  As far as I can tell it's only needed to get the version 
information.  VMS doesn't have autoconf (that I know of) so I can't 
generate it locally.

1a.  Related to a lack of autoconf - CVS has a number of files in the 
attic that are in the nightly snapshot that are generated by autoconf.  
Some of the attic'ed files are required for the build to work.  These 
files are
    src/tds/tdsver.h
    src/tds/tds_willconvert.h
    include/encodings.h
    src/tds/num_limits.h
I had to get all of these from the snapshot.

2. In src/dblib/dblib.c the dbdatecrack function references the Sybase 
date fields.  I just commented out the MSDBLIB  compiler directive in 
sybdb.h and it compiled OK.
Dblib unittest T0012 fails to compile as a result, but a similar change 
there works OK.

3.  ctlib/ct.c uses snprintf()  which generates a compiler message about 
an implicit function declaration.  This relates to my version of vms 
(7.2-1) not having that function so I grabbed the source from 
http://www.ijs.si/software/snprintf/ and built using that, then put the 
.obj file into the libct.olb library.

4.  include/replacements.h has a path reference to reaspassphrase.h.  
The compiler couldn't find the file so I changed the code as follows:
#if !HAVE_READPASSPHRASE
#if defined(__VMS)
# include <./src/replacements/readpassphrase.h>
#else
# include <../src/replacements/readpassphrase.h>
#endif

5.  src/dblib/buffering.h has a function static void 
*buffer_row_address().  The return statement generates a compiler 
warning for doing calculations on a void pointer.  I changed the return 
statement to:
    return (void *)((long*)buf->rows + offset);

6.  net.c complained failed to find a declaration for TCP_NODELAY (since 
UCX uses UCX$...).  I just hardcoded a couple of values to get it working.

#elif defined(TCP_NODELAY) && defined(SOL_TCP)
#define USE_NODELAY 1
#elif defined(__VMS)
        #define TCP_NODELAY 1
        #define USE_NODELAY 1
#endif

7.  When running the unittests:
    dblib tests t0003, t0007 & t0008 crash  ("somebody overwrote one of 
the breadcrumbs" then an exception).
    I haven't looked into why these are failing.

I hope someone finds this useful :-)

- Richard


More information about the FreeTDS mailing list