Re: ct-lib unit tests link statically

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
ZIGLIO, Frediano, VF-IT wrote:
> > I noticed the ct-lib unit tests were linking to the installed shared
> > object.  That's not optimal behavior; it's nice to run the unit tests
> > before installing.  Now they link statically to the 
> > uninstalled libct.a.  
> > 
> > Enjoy.  
> > 
> 
> On Linux ctlib unitests now don't compile:
> 

Should work now, with src/ctlib/unittests/Makefile.am revision 1.27. 
Works for me.  

$ ldd build/src/ctlib/unittests/datafmt 
build/src/ctlib/unittests/datafmt:
         -lpthread.0 => /usr/lib/libpthread.so.0
         -lc.12 => /usr/lib/libc.so.12

$ ident /usr/local/lib/libct.a | grep ct.c
     $Id: ct.c,v 1.179 2008/05/22 01:32:32 jklowden Exp $

$ ident build/src/ctlib/unittests/datafmt | grep ct.c
     $Id: ct.c,v 1.180 2008/07/05 22:57:54 jklowden Exp $

$ cvs diff -D '7/3/2008' src/ctlib/unittests/Makefile.am
Index: src/ctlib/unittests/Makefile.am
===================================================================
RCS file: /cvsroot/freetds/freetds/src/ctlib/unittests/Makefile.am,v
retrieving revision 1.25
retrieving revision 1.27
diff -u -r1.25 -r1.27
--- src/ctlib/unittests/Makefile.am     16 Aug 2007 08:10:09 -0000     
1.25
+++ src/ctlib/unittests/Makefile.am     7 Jul 2008 21:43:24 -0000      
1.27
@@ -1,10 +1,12 @@
-# $Id: Makefile.am,v 1.25 2007/08/16 08:10:09 freddy77 Exp $
+# $Id: Makefile.am,v 1.27 2008/07/07 21:43:24 jklowden Exp $
+
 TESTS          =       t0001 t0002 t0003 t0004 t0005 t0006 t0007 t0008
t0009 \
                        connect_fail ct_options lang_ct_param array_bind
cs_diag \
                        get_send_data rpc_ct_param rpc_ct_setparam
ct_diagclient \
                        ct_diagserver ct_diagall cs_config cancel \
                        blk_in blk_out ct_cursor ct_cursors \
-                       ct_dynamic blk_in2
+                       ct_dynamic blk_in2 datafmt
+
 check_PROGRAMS =       $(TESTS)
 
 t0001_SOURCES          = t0001.c common.c common.h
@@ -35,6 +37,7 @@
 ct_cursors_SOURCES     = ct_cursors.c common.c common.h
 ct_dynamic_SOURCES     = ct_dynamic.c common.c common.h
 blk_in2_SOURCES                = blk_in2.c common.c common.h
+datafmt_SOURCES                = datafmt.c common.c common.h
 
 AM_CPPFLAGS    =       -I$(top_srcdir)/include
 if MINGW32
@@ -42,5 +45,5 @@
 else
 AM_LDFLAGS     =       -no-install
 endif
-LIBS           =       ../libct.la @NETWORK_LIBS@
+LIBS           =       ../libct.la -static @NETWORK_LIBS@
 CLEANFILES     =       tdsdump.out

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.