Skip to Content.
Sympa Menu

freetds - Re: Building FREETDS

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Langasek <vorlon AT netexpress.net>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Building FREETDS
  • Date: Sun, 4 Nov 2001 22:07:43 -0600

On Sun, Nov 04, 2001 at 07:44:03PM -0500, Brian Bruns wrote:
> On Sun, 4 Nov 2001, Steve Langasek wrote:

> > Such a change should be accompanied by incrementing the major number of
> > libsybdb.so, as it represents a backwards-incompatible change to the
> > ABI (depending how the library was compiled previously). Other than
> > that, I don't see any problems with such a solution, and many benefits
> > (in the form of fewer support requests, and more stuff just working for
> > people). So unless anyone sees a downside that I've missed, I'll put
> > together a patch against CVS for this within a couple of days.

> I don't have a problem with this...there have been a few big changes since
> 0.53pre1 anyway, so we might as well go for it. Regarding the library
> naming, good point.

Good enough. Attaching the patch here. Features:

* removes the --enable-dbmfix argument to configure. This now becomes a
no-op, so no one's build scripts will break from this change.
* always uses tdsdbopen + macro.
* sets the library version number on libsybdb.
* removes dbmfix references from the users guide sgml.

Patch does not include generated files; whoever commits this to CVS
should first run automake && autoconf, so that related files are also
updated.

> > P.S., is there an issue with threading on this list? I thought it used
> > to work ok, but mutt definitely isn't able to make head or tail of
> > message IDs currently...

> Mailing list uses lyris if that helps at all...I don't thread
> personally...the web archive seems to do an ok job though.

Perhaps it was just an issue with mail clients some subscribers were
using... everything seems to be working fine, now.

Cheers,
Steve Langasek
postmodern programmer
Index: ChangeLog
===================================================================
RCS file: /Repository/freetds/ChangeLog,v
retrieving revision 1.21
diff -u -w -r1.21 ChangeLog
--- ChangeLog 2001/09/27 12:09:40 1.21
+++ ChangeLog 2001/11/05 03:55:13
@@ -1,3 +1,5 @@
+- Removed --enable-dbmfix configure option, because there's no longer a
+ reason to ever disable this
- tdspool now working for big endian systems
- Fixed mem leak in ctlib
- Added some descriptive text to the PWD file
Index: INSTALL
===================================================================
RCS file: /Repository/freetds/INSTALL,v
retrieving revision 1.9
diff -u -w -r1.9 INSTALL
--- INSTALL 2000/11/08 21:56:28 1.9
+++ INSTALL 2001/11/05 03:55:13
@@ -5,7 +5,7 @@

Until these instructions are more specific, try the following:

- $ ./configure [--prefix=<install dir>] [--with-tdsver=<tds version>]
[--enable-msdblib] [--enable-dbmfix]
+ $ ./configure [--prefix=<install dir>] [--with-tdsver=<tds version>]
[--enable-msdblib]
the default prefix is /usr/local/freetds
The default TDS version is 5.0, use 4.2 for MS-SQL or Sybase < 10.0
Use 7.0 to get support for unicode and large varchars under SQL
@@ -44,11 +44,6 @@
for dblib (the two diverge in some areas). This is helpful when porting dblib
code coming from a Windows environment. In general do not use if you are
using
Sybase derived tools to connect to SQL Server (PHP, DBD::Sybase, etc...)
-
- The --enable-dbmfix flag will rename dbopen() to tdsdbopen() to allow the
-dblib library to be linked into the same executable with dbm. However, this
-means references to 'dbopen' must be changed in the client application.
Check
-the FreeTDS website (http://www.freetds.org) for patches for PHP 4.

To run the test programs, edit the file "PWD" and run 'make check'.
Note that some test programs mail may fail even though TDS is fine.
Index: configure.in
===================================================================
RCS file: /Repository/freetds/configure.in,v
retrieving revision 1.28
diff -u -w -r1.28 configure.in
--- configure.in 2001/09/27 12:09:40 1.28
+++ configure.in 2001/11/05 03:55:14
@@ -147,14 +147,6 @@
CFLAGS="$CFLAGS -DMSDBLIB"
fi

-AC_ARG_ENABLE(dbmfix,
- [ --enable-dbmfix Fix conflict with the dbm dbopen.])
-
-if test "$enable_dbmfix" = "yes" ; then
- CFLAGS="$CFLAGS -DDBMFIX"
-fi
-
-
dnl ------------------------------------------------------------
dnl Final output
dnl ------------------------------------------------------------
Index: doc/userguide.sgml
===================================================================
RCS file: /Repository/freetds/doc/userguide.sgml,v
retrieving revision 1.9
diff -u -w -r1.9 userguide.sgml
--- userguide.sgml 2001/06/18 22:23:19 1.9
+++ userguide.sgml 2001/11/05 03:55:15
@@ -272,13 +272,6 @@
</listitem>
</varlistentry>

- <varlistentry>
- <term><Parameter>--enable-dbmfix
- </Parameter></term>
- <listitem><para>Force the function dbopen()
in the dblib API to be renamed tdsdbopen(). This option is used to avoid a
conflict with programs that link in both dblib and some flavor of DBM (ndbm,
gdbm, etc...). Note the application will have to be modified to call
tdsdbopen() instead, see the <link linkend="php">PHP Section</link> for
information on fixing this in PHP.</para>
- </listitem>
- </varlistentry>
-
</variablelist>
<para>
Now you're ready to build. Follow these easy steps.
@@ -969,10 +962,14 @@
<para>
There are three options for building PHP with support for FreeTDS
corresponding to the three APIs that FreeTDS supports: <type>dblib</type>,
<type>ctlib</type>, and <type>ODBC</type>.
</para>
+<note><para>All these examples build the CGI version. Consult PHPs
documentation for building the apache module and including other
extensions.</para></note>
<sect2 id="phpDblib">
<title>Dblib</title>
<para>
-Dblib is perhaps the most straightforward to build. The only caveat here is
that you may run into the dbm conflict which would require some hand editing
of PHP sources. This first example assumes that PHP is
<emphasis>not</emphasis> built with DBM.
+Dblib is perhaps the most straightforward to build. Previously, some
+source code tweaking was required to build PHP with both Dblib and DBM
+support, but as of version 0.53, FreeTDS now handles this
+automatically.
</para>
<para>
First build FreeTDS normally.
@@ -993,26 +990,6 @@
<prompt>$ </prompt><userinput>make install</userinput>
</screen>
And that's it!
-<note><para>All these examples build the CGI version. Consult PHPs
documentation for building the apache module and including other
extensions.</para></note>
- </para>
- <para>
-If you need to include support for DBM in PHP, configure FreeTDS with the
dbmfix option, this will automatically rename dblib's dbopen() function to
tdsdbopen().
-<screen>
-<prompt>$ </prompt><userinput>./configure --prefix=/usr/local/freetds
--enable-dbmfix</userinput>
-<prompt>$ </prompt><userinput>gmake</userinput>
-<prompt>$ </prompt><userinput>su root</userinput>
-<prompt>Password: </prompt>
-<prompt>$ </prompt><userinput>gmake install</userinput>
-</screen>
-Next edit the file ext/sybase/php_sybase_db.c in the PHP source directory.
Look for the text 'dbopen' and replace it with 'tdsdbopen'. At the time of
this writing there were 3 occurances of it. Then build PHP with support for
'sybase' and 'DBM'
-<screen>
-<prompt>$ </prompt><userinput>cd php</userinput>
-<prompt>$ </prompt><userinput>./configure --with-sybase=/usr/local/freetds
--with-dbm</userinput>
-<prompt>$ </prompt><userinput>make</userinput>
-<prompt>$ </prompt><userinput>su root</userinput>
-<prompt>Password: </prompt>
-<prompt>$ </prompt><userinput>make install</userinput>
-</screen>
</para>
</sect2>
<sect2>
Index: include/sybdb.h
===================================================================
RCS file: /Repository/freetds/include/sybdb.h,v
retrieving revision 1.31
diff -u -w -r1.31 sybdb.h
--- sybdb.h 2001/07/02 00:57:40 1.31
+++ sybdb.h 2001/11/05 03:55:15
@@ -298,12 +298,8 @@
extern RETCODE DBSETLUSER(LOGINREC *login, char *username);
extern RETCODE DBSETLHOST(LOGINREC *login, char *hostname);
extern RETCODE DBSETLAPP(LOGINREC *login, char *application);
-#ifdef DBMFIX
extern DBPROCESS *tdsdbopen(LOGINREC *login,char *server);
#define dbopen(x,y) tdsdbopen(x,y)
-#else
-extern DBPROCESS *dbopen(LOGINREC *login,char *server);
-#endif
extern RETCODE dbclose(DBPROCESS *dbprocess);
extern DBINT dbconvert(DBPROCESS *dbproc, int srctype,
BYTE *src, DBINT srclen, int desttype, BYTE
*dest,
Index: src/dblib/Makefile.am
===================================================================
RCS file: /Repository/freetds/src/dblib/Makefile.am,v
retrieving revision 1.6
diff -u -w -r1.6 Makefile.am
--- Makefile.am 2001/07/10 20:31:19 1.6
+++ Makefile.am 2001/11/05 03:55:15
@@ -4,6 +4,7 @@
TDSSOURCES = mem.c token.c util.c login.c read.c write.c convert.c
numeric.c config.c query.c
lib_LTLIBRARIES = libsybdb.la
libsybdb_la_SOURCES= dblib.c dbutil.c rpc.c bcp.c xact.c
+libsybdb_la_LDFLAGS= -version-info 1 0 0
libsybdb_la_LIBADD= $(patsubst %, $(TDSDIR)/%, \
$(patsubst %.c, %.lo, $(TDSSOURCES)))
INCLUDES = -I$(top_srcdir)/include
Index: src/dblib/dblib.c
===================================================================
RCS file: /Repository/freetds/src/dblib/dblib.c,v
retrieving revision 1.82
diff -u -w -r1.82 dblib.c
--- dblib.c 2001/06/09 23:48:48 1.82
+++ dblib.c 2001/11/05 03:55:16
@@ -427,11 +427,7 @@
tds_set_app(login->tds_login,application);
return SUCCEED;
}
-#ifdef DBMFIX
DBPROCESS *tdsdbopen(LOGINREC *login,char *server)
-#else
-DBPROCESS *dbopen(LOGINREC *login,char *server)
-#endif
{
DBPROCESS *dbproc;
char *envbuf;

Attachment: pgpOw7LQAzu9c.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page