[freetds] Compiling tsql
James K. Lowden
jklowden at freetds.org
Sat May 26 10:17:21 EDT 2007
Tim Goossens wrote:
> I would like to adjust the tsql program to my own specific needs, so I
> want to try to compile it from tsql.c. Is this possible in a easy way,
> without using a makefile? I am currently studying the makefile, but it
> reads pretty much like gibberish.
Before you do that, I suggest you look at bsqldb and, in the current
snapshot, fisql. They both use the db-lib API, whereas tsql uses libtds
directly. It makes them easier to modify. And I think you'll find fisql
in particular is already much more functional than tsql.
tsql has a specific purpose: to test the underlying TDS implementation
independent of the client libraries that use it. For example, db-lib uses
libtds; if tsql shows a problem with a particular server or query, we know
the problem is in libtds, not db-lib.
We occasionally get patches for tsql to make it more functional. I think
it's the wrong program to "improve" because the libtds functions change
with each release. It's enough that it does what it does.
My other suggestion, since you said you're looking for the "easy way", is
to write your own Makefile from scratch. Something like this:
SRC = [the sources]
LIBS = [the libraries]
OPTIONS = [the options]
application: $(SRC) [and the .h files]
gcc -d -o $@ $(OPTIONS) $(SRC) $(LIBS)
I think you'll find that a better solution than using the command line or
writing script. :-)
More information about the FreeTDS