diff -uNr mysql-5.0.76-old/client/Makefile.am mysql-5.0.76/client/Makefile.am
--- mysql-5.0.76-old/client/Makefile.am	2009-01-15 16:44:51.000000000 -0100
+++ mysql-5.0.76/client/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -37,7 +37,7 @@
 				$(top_srcdir)/mysys/my_copy.c \
 				$(top_srcdir)/mysys/my_mkdir.c
 
-mysqltest_LDADD =		$(top_builddir)/regex/libregex.a $(LDADD)
+mysqltest_LDADD =		$(top_builddir)/regex/libregex.la $(LDADD)
 mysqlbinlog_SOURCES =   	mysqlbinlog.cc \
 				$(top_srcdir)/mysys/mf_tempdir.c \
 				$(top_srcdir)/mysys/my_new.cc
diff -uNr mysql-5.0.76-old/configure.in mysql-5.0.76/configure.in
--- mysql-5.0.76-old/configure.in	2009-01-15 16:44:57.000000000 -0100
+++ mysql-5.0.76/configure.in	2009-03-15 14:39:34.000000000 -0100
@@ -574,6 +574,9 @@
 # We need an ANSI C compiler
 AM_PROG_CC_STDC
 
+# Testing as sugggested by Diego
+AM_PROG_CC_C_O
+
 # We need an assembler, too
 AM_PROG_AS
 CCASFLAGS="$CCASFLAGS $ASFLAGS"
@@ -2692,9 +2695,9 @@
 
 if test "$THREAD_SAFE_CLIENT" = "no"
 then
-  sql_client_dirs="strings regex mysys dbug extra libmysql client"
+  sql_client_dirs="strings regex dbug mysys extra libmysql client"
 else
-  sql_client_dirs="strings regex mysys dbug extra libmysql libmysql_r client"
+  sql_client_dirs="strings regex dbug mysys extra libmysql libmysql_r client"
   linked_client_targets="$linked_client_targets linked_libmysql_r_sources"
   AC_CONFIG_FILES(libmysql_r/Makefile)
   AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
@@ -2723,13 +2726,11 @@
 export CC CXX CFLAGS CXXFLAGS LD LDFLAGS AR
 ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'"
 
+AM_CONDITIONAL([NEED_THREADS], [test x"$with_server" != xno -o x"$THREAD_SAFE_CLIENT" != xno])
 if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"
 then
   AC_DEFINE([THREAD], [1],
             [Define if you want to have threaded code. This may be undef on client code])
-  # Avoid _PROGRAMS names
-  THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o"
-  AC_SUBST(THREAD_LOBJECTS)
 fi
 
 if test "$with_server" = "no"
@@ -2737,7 +2738,7 @@
   AM_CONDITIONAL([BUILD_INNODB_TOOLS], [false])
 else
   server_scripts="mysqld_safe mysql_install_db"
-  sql_server_dirs="strings mysys dbug extra regex"
+  sql_server_dirs="strings dbug mysys extra regex"
 
 
   #
diff -uNr mysql-5.0.76-old/dbug/Makefile.am mysql-5.0.76/dbug/Makefile.am
--- mysql-5.0.76-old/dbug/Makefile.am	2009-01-15 16:44:57.000000000 -0100
+++ mysql-5.0.76/dbug/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -16,10 +16,9 @@
 # MA 02111-1307, USA
 
 INCLUDES =              -I$(top_builddir)/include -I$(top_srcdir)/include
-LDADD =                 libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a
-pkglib_LIBRARIES =      libdbug.a
+noinst_LTLIBRARIES =    libdbug.la
 noinst_HEADERS =        dbug_long.h
-libdbug_a_SOURCES =     dbug.c sanity.c
+libdbug_la_SOURCES =    dbug.c sanity.c
 EXTRA_DIST =            example1.c example2.c example3.c \
                         user.r monty.doc readme.prof dbug_add_tags.pl \
                         my_main.c main.c factorial.c dbug_analyze.c \
@@ -31,11 +30,11 @@
 
 
 # Must be linked with libs that are not compiled yet
-noinst_PROGRAMS =       factorial dbug_analyze
+EXTRA_PROGRAMS =       factorial dbug_analyze
 factorial_SOURCES =     my_main.c factorial.c
 dbug_analyze_SOURCES =  dbug_analyze.c
 
-all:            user.t user.ps
+check-local:            user.t user.ps
 
 user.t:         user.r $(NROFF_INC)
 		-nroff -mm user.r > $@
diff -uNr mysql-5.0.76-old/extra/Makefile.am mysql-5.0.76/extra/Makefile.am
--- mysql-5.0.76-old/extra/Makefile.am	2009-01-15 16:44:58.000000000 -0100
+++ mysql-5.0.76/extra/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -15,8 +15,7 @@
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include \
 			@ndbcluster_includes@ -I$(top_srcdir)/sql
-LDADD =			@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
-			../dbug/libdbug.a ../strings/libmystrings.a \
+LDADD =			@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.la \
 			$(ZLIB_LIBS)
 BUILT_SOURCES=		$(top_builddir)/include/mysqld_error.h \
                         $(top_builddir)/include/sql_state.h \
diff -uNr mysql-5.0.76-old/heap/Makefile.am mysql-5.0.76/heap/Makefile.am
--- mysql-5.0.76-old/heap/Makefile.am	2009-01-15 16:45:05.000000000 -0100
+++ mysql-5.0.76/heap/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -14,14 +14,13 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include 
-LDADD =			libheap.a ../mysys/libmysys.a ../dbug/libdbug.a \
-			../strings/libmystrings.a
-pkglib_LIBRARIES =	libheap.a
+LDADD =			libheap.la ../mysys/libmysys.la
+pkglib_LTLIBRARIES =	libheap.la
 noinst_PROGRAMS	=	hp_test1 hp_test2
 hp_test1_LDFLAGS = @NOINST_LDFLAGS@
 hp_test2_LDFLAGS = @NOINST_LDFLAGS@
 noinst_HEADERS =	heapdef.h
-libheap_a_SOURCES =	hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
+libheap_la_SOURCES =	hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
 			hp_rrnd.c hp_scan.c hp_update.c hp_write.c hp_delete.c \
 			hp_rsame.c hp_create.c hp_rename.c hp_rfirst.c \
 			hp_rnext.c hp_rlast.c hp_rprev.c hp_clear.c \
diff -uNr mysql-5.0.76-old/include/keycache.h mysql-5.0.76/include/keycache.h
--- mysql-5.0.76-old/include/keycache.h	2009-01-15 16:45:06.000000000 -0100
+++ mysql-5.0.76/include/keycache.h	2009-03-15 14:39:34.000000000 -0100
@@ -39,7 +42,7 @@
 /*
   The key cache structure
   It also contains read-only statistics parameters.
-*/   
+*/
 
 typedef struct st_key_cache
 {
diff -uNr mysql-5.0.76-old/include/m_ctype.h mysql-5.0.76/include/m_ctype.h
--- mysql-5.0.76-old/include/m_ctype.h	2009-01-15 16:45:06.000000000 -0100
+++ mysql-5.0.76/include/m_ctype.h	2009-03-15 14:39:34.000000000 -0100
@@ -77,7 +78,7 @@
 #define MY_CS_UNICODE	128    /* is a charset is full unicode   */
 #define MY_CS_READY	256    /* if a charset is initialized    */
 #define MY_CS_AVAILABLE	512    /* If either compiled-in or loaded*/
-#define MY_CS_CSSORT	1024   /* if case sensitive sort order   */	
+#define MY_CS_CSSORT	1024   /* if case sensitive sort order   */
 #define MY_CS_PUREASCII 2048   /* if a charset is pure ascii     */
 #define MY_CHARSET_UNDEFINED 0
 
@@ -103,14 +104,14 @@
 
 enum my_lex_states
 {
-  MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, 
+  MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
   MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
   MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
   MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
   MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
-  MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, 
-  MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, 
-  MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, 
+  MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
+  MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON,
+  MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
   MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
   MY_LEX_IDENT_OR_KEYWORD,
   MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
@@ -132,10 +133,10 @@
                          my_bool diff_if_only_endspace_difference);
   int     (*strnxfrm)(struct charset_info_st *,
 		      uchar *, uint, const uchar *, uint);
-  uint    (*strnxfrmlen)(struct charset_info_st *, uint); 
+  uint    (*strnxfrmlen)(struct charset_info_st *, uint);
   my_bool (*like_range)(struct charset_info_st *,
 			const char *s, uint s_length,
-			pchar w_prefix, pchar w_one, pchar w_many, 
+			pchar w_prefix, pchar w_one, pchar w_many,
 			uint res_length,
 			char *min_str, char *max_str,
 			uint *min_len, uint *max_len);
@@ -145,15 +146,15 @@
                      int escape,int w_one, int w_many);
 
   int  (*strcasecmp)(struct charset_info_st *, const char *, const char *);
-  
+
   uint (*instr)(struct charset_info_st *,
                 const char *b, uint b_length,
                 const char *s, uint s_length,
                 my_match_t *match, uint nmatch);
-  
+
   /* Hash calculation */
   void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
-		    ulong *nr1, ulong *nr2); 
+		    ulong *nr1, ulong *nr2);
   my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len);
 } MY_COLLATION_HANDLER;
 
@@ -177,13 +178,13 @@
                              uint nchars, int *error);
   uint    (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
   uint    (*numcells)(struct charset_info_st *, const char *b, const char *e);
-  
+
   /* Unicode convertion */
   int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
 	       const unsigned char *s,const unsigned char *e);
   int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
 	       unsigned char *s,unsigned char *e);
-  
+
   /* Functions for case and sort convertion */
   uint    (*caseup_str)(struct charset_info_st *, char *);
   uint    (*casedn_str)(struct charset_info_st *, char *);
@@ -191,7 +192,7 @@
                                               char *dst, uint dstlen);
   uint    (*casedn)(struct charset_info_st *, char *src, uint srclen,
                                               char *dst, uint dstlen);
-  
+
   /* Charset dependant snprintf() */
   int  (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
 		   ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5);
@@ -199,9 +200,9 @@
 			long int val);
   int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
 			   int radix, longlong val);
-  
+
   void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
-  
+
   /* String-to-number convertion routines */
   long        (*strntol)(struct charset_info_st *, const char *s, uint l,
 			 int base, char **e, int *err);
@@ -257,10 +258,10 @@
   uint16    max_sort_char; /* For LIKE optimization */
   uchar     pad_char;
   my_bool   escape_with_backslash_is_dangerous;
-  
+
   MY_CHARSET_HANDLER *cset;
   MY_COLLATION_HANDLER *coll;
-  
+
 } CHARSET_INFO;
 
 
@@ -297,8 +298,8 @@
 
 /* declarations for simple charsets */
 extern int  my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
-                               uint); 
-uint  my_strnxfrmlen_simple(CHARSET_INFO *, uint); 
+                               uint);
+uint  my_strnxfrmlen_simple(CHARSET_INFO *, uint);
 extern int  my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
 				const uchar *, uint, my_bool);
 
@@ -308,7 +309,7 @@
 
 extern void my_hash_sort_simple(CHARSET_INFO *cs,
 				const uchar *key, uint len,
-				ulong *nr1, ulong *nr2); 
+				ulong *nr1, ulong *nr2);
 
 extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
 
@@ -354,13 +355,13 @@
 
 longlong my_strtoll10_8bit(CHARSET_INFO *cs,
                            const char *nptr, char **endptr, int *error);
-longlong my_strtoll10_ucs2(CHARSET_INFO *cs, 
+longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
                            const char *nptr, char **endptr, int *error);
 
 ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs,
                                  const char *str, uint length, int unsigned_fl,
                                  char **endptr, int *error);
-ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, 
+ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs,
                                  const char *str, uint length, int unsigned_fl,
                                  char **endptr, int *error);
 
diff -uNr mysql-5.0.76-old/libmysql/Makefile.am mysql-5.0.76/libmysql/Makefile.am
--- mysql-5.0.76-old/libmysql/Makefile.am	2009-01-15 16:45:19.000000000 -0100
+++ mysql-5.0.76/libmysql/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -106,8 +106,8 @@
 	echo "# This file is autogenerated from Makefile.am" >> $$dir/Makefile; \
 	echo 'CFLAGS=	-I. -DUNDEF_THREADS_HACK' >>$$dir/Makefile; \
 	echo "obj=$$objs"  >>$$dir/Makefile; \
-	echo 'all: libmysql.a'  >>$$dir/Makefile; \
-	echo 'libmysql.a: $$(obj)'  >>$$dir/Makefile; \
+	echo 'all: libmysql.la'  >>$$dir/Makefile; \
+	echo 'libmysql.la: $$(obj)'  >>$$dir/Makefile; \
 	echo '	$$(AR) r $$@ $$?'  >>$$dir/Makefile; \
 	gtar cvzf $$dir.tar.gz $$dir; \
 	cd $$dir; gmake
diff -uNr mysql-5.0.76-old/libmysqld/Makefile.am mysql-5.0.76/libmysqld/Makefile.am
--- mysql-5.0.76-old/libmysqld/Makefile.am	2009-01-15 16:45:20.000000000 -0100
+++ mysql-5.0.76/libmysqld/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -32,8 +32,8 @@
 			-I$(top_srcdir)/regex \
 			$(openssl_includes) @ZLIB_INCLUDES@
 
-noinst_LIBRARIES =	libmysqld_int.a
-pkglib_LIBRARIES =	libmysqld.a
+noinst_LTLIBRARIES =	libmysqld_int.la
+pkglib_LTLIBRARIES =	libmysqld.la
 SUBDIRS =		. examples
 libmysqld_sources=	libmysqld.c lib_sql.cc emb_qcache.cc
 libmysqlsources =	errmsg.c get_password.c libmysql.c client.c pack.c \
@@ -44,7 +44,7 @@
 
 sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
 	ha_innodb.cc ha_berkeley.cc ha_heap.cc ha_federated.cc \
-	ha_myisam.cc ha_myisammrg.cc handler.cc sql_handler.cc \
+        handler.cc sql_handler.cc \
 	hostname.cc init.cc password.c \
 	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
 	item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
@@ -66,50 +66,21 @@
 	parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
 	ha_blackhole.cc ha_archive.cc my_user.c
 
-libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
-libmysqld_a_SOURCES=
+libmysqld_int_la_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
+libmysqld_la_SOURCES=
 
 # automake misses these
 sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
 
-# The following libraries should be included in libmysqld.a
-INC_LIB=	$(top_builddir)/regex/libregex.a \
-		$(top_builddir)/myisam/libmyisam.a \
-		$(top_builddir)/myisammrg/libmyisammrg.a \
-		$(top_builddir)/heap/libheap.a \
+# The following libraries should be included in libmysqld.la
+libmysqld_la_LIBADD=	$(top_builddir)/regex/libregex.la \
+		$(top_builddir)/myisam/libmyisam.la \
+		$(top_builddir)/myisammrg/libmyisammrg.la \
+		$(top_builddir)/heap/libheap.la \
 		@innodb_libs@ @bdb_libs_with_path@ \
-		$(top_builddir)/mysys/libmysys.a \
-		$(top_builddir)/strings/libmystrings.a \
-		$(top_builddir)/dbug/libdbug.a \
-		$(top_builddir)/vio/libvio.a @NDB_SCI_LIBS@
-
-
-#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
-
-# note - InnoDB libraries have circular dependencies, so in INC_LIB
-# few libraries are present two times. Metrowerks linker doesn't like
-# it at all. Traditional ar has no problems with it, but still there's no
-# need to add the same file twice to the library, so 'sort -u' save us
-# some time and spares unnecessary work.
-
-libmysqld.a:	libmysqld_int.a $(INC_LIB)
-if DARWIN_MWCC
-	mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u`
-else
-		-rm -f libmysqld.a
-		if test "$(host_os)" = "netware" ; \
-		then \
-		  $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
-		else \
-		  for arc in ./libmysqld_int.a $(INC_LIB); do \
-		    arpath=`echo $$arc|sed 's|[^/]*$$||'`; \
-		    $(AR) t $$arc|sed "s|^|$$arpath|"; \
-		  done | sort -u | xargs $(AR) cq libmysqld.a ; \
-		  $(RANLIB) libmysqld.a	; \
-		fi
-endif
+		$(top_builddir)/mysys/libmysys.la \
+		$(top_builddir)/vio/libvio.la @NDB_SCI_LIBS@ \
+		libmysqld_int.la
 
 ## XXX: any time the client interface changes, we'll need to bump
 ## the version info for libmysqld; however, it's possible for the
diff -uNr mysql-5.0.76-old/myisam/Makefile.am mysql-5.0.76/myisam/Makefile.am
--- mysql-5.0.76-old/myisam/Makefile.am	2009-01-15 16:45:21.000000000 -0100
+++ mysql-5.0.76/myisam/Makefile.am	2009-03-15 14:50:25.000000000 -0100
@@ -16,27 +16,27 @@
 EXTRA_DIST =		mi_test_all.sh mi_test_all.res ft_stem.c CMakeLists.txt
 pkgdata_DATA =		mi_test_all mi_test_all.res
 
-INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include
-LDADD =			@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-pkglib_LIBRARIES =	libmyisam.a
+INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include \
+				-I$(top_builddir)/sql -I$(top_srcdir)/sql
+LDADD =			@CLIENT_EXTRA_LDFLAGS@ libmyisam.la \
+			$(top_builddir)/mysys/libmysys.la \
+			$(ZLIB_LIBS)
+noinst_LTLIBRARIES =	libmyisam.la
 bin_PROGRAMS =		myisamchk myisamlog myisampack myisam_ftdump
-myisamchk_DEPENDENCIES=	$(LIBRARIES)
-myisamlog_DEPENDENCIES=	$(LIBRARIES)
-myisampack_DEPENDENCIES=$(LIBRARIES)
+myisamchk_DEPENDENCIES=	$(LTLIBRARIES)
+myisamlog_DEPENDENCIES=	$(LTLIBRARIES)
+myisampack_DEPENDENCIES=$(LTLIBRARIES)
 noinst_PROGRAMS =	mi_test1 mi_test2 mi_test3 rt_test sp_test #ft_test1 ft_eval
 noinst_HEADERS =	myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h fulltext.h ftdefs.h ft_test1.h ft_eval.h
-mi_test1_DEPENDENCIES=	$(LIBRARIES)
-mi_test2_DEPENDENCIES=	$(LIBRARIES)
-mi_test3_DEPENDENCIES=	$(LIBRARIES)
-#ft_test1_DEPENDENCIES=	$(LIBRARIES)
-#ft_eval_DEPENDENCIES=	$(LIBRARIES)
-myisam_ftdump_DEPENDENCIES=	$(LIBRARIES)
-rt_test_DEPENDENCIES=	$(LIBRARIES)
-sp_test_DEPENDENCIES=	$(LIBRARIES)
-libmyisam_a_SOURCES =	mi_open.c mi_extra.c mi_info.c mi_rkey.c \
+mi_test1_DEPENDENCIES=	$(LTLIBRARIES)
+mi_test2_DEPENDENCIES=	$(LTLIBRARIES)
+mi_test3_DEPENDENCIES=	$(LTLIBRARIES)
+#ft_test1_DEPENDENCIES=	$(LTLIBRARIES)
+#ft_eval_DEPENDENCIES=	$(LTLIBRARIES)
+myisam_ftdump_DEPENDENCIES=	$(LTLIBRARIES)
+rt_test_DEPENDENCIES=	$(LTLIBRARIES)
+sp_test_DEPENDENCIES=	$(LTLIBRARIES)
+libmyisam_la_SOURCES =	mi_open.c mi_extra.c mi_info.c mi_rkey.c \
 			mi_rnext.c mi_rnext_same.c \
 			mi_search.c mi_page.c mi_key.c mi_locking.c \
 			mi_rrnd.c mi_scan.c mi_cache.c \
diff -uNr mysql-5.0.76-old/myisammrg/Makefile.am mysql-5.0.76/myisammrg/Makefile.am
--- mysql-5.0.76-old/myisammrg/Makefile.am	2009-01-15 16:45:25.000000000 -0100
+++ mysql-5.0.76/myisammrg/Makefile.am	2009-03-15 15:06:17.000000000 -0100
@@ -14,9 +14,9 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include
-pkglib_LIBRARIES =	libmyisammrg.a
+noinst_LTLIBRARIES =	libmyisammrg.la
 noinst_HEADERS =	myrg_def.h
-libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
+libmyisammrg_la_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
 			myrg_rrnd.c myrg_update.c myrg_delete.c myrg_rsame.c \
 			myrg_panic.c myrg_close.c myrg_create.c myrg_static.c \
 			myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \
diff -uNr mysql-5.0.76-old/mysys/Makefile.am mysql-5.0.76/mysys/Makefile.am
--- mysql-5.0.76-old/mysys/Makefile.am	2009-01-15 16:47:01.000000000 -0100
+++ mysql-5.0.76/mysys/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -18,14 +18,12 @@
 MYSQLBASEdir=		$(prefix)
 INCLUDES =		@ZLIB_INCLUDES@ -I$(top_builddir)/include \
 			-I$(top_srcdir)/include -I$(srcdir)
-pkglib_LIBRARIES =	libmysys.a
-LDADD =			libmysys.a ../dbug/libdbug.a \
-			../strings/libmystrings.a
+pkglib_LTLIBRARIES =	libmysys.la
 noinst_HEADERS =	mysys_priv.h my_static.h \
 			my_os2cond.c my_os2dirsrch.c my_os2dirsrch.h \
 			my_os2dlfcn.c my_os2file64.c my_os2mutex.c \
 			my_os2thread.c my_os2tls.c
-libmysys_a_SOURCES =    my_init.c my_getwd.c mf_getdate.c my_mmap.c \
+libmysys_la_SOURCES =    my_init.c my_getwd.c mf_getdate.c my_mmap.c \
 			mf_path.c mf_loadpath.c my_file.c \
 			my_open.c my_create.c my_dup.c my_seek.c my_read.c \
 			my_pread.c my_write.c my_getpagesize.c \
@@ -49,21 +47,26 @@
 			my_quick.c my_lockmem.c my_static.c \
 			my_sync.c my_getopt.c my_mkdir.c \
 			default_modify.c default.c \
-                        my_compress.c checksum.c raid.cc \
+			my_compress.c checksum.c raid.cc \
 			my_net.c my_port.c my_sleep.c \
 			charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
 			my_gethostbyname.c rijndael.c my_aes.c sha1.c \
 			my_handler.c my_netware.c my_largepage.c \
-			my_memmem.c \
-			my_windac.c my_access.c base64.c my_libwrap.c
+			my_memmem.c my_windac.c my_access.c base64.c \
+			my_libwrap.c
+libmysys_la_LIBADD = $(top_builddir)/dbug/libdbug.la $(top_builddir)/strings/libmystrings.la \
+			$(ZLIB_LIBS)
+if NEED_THREADS
+libmysys_la_SOURCES += thr_alarm.c thr_lock.c thr_mutex.c thr_rwlock.c my_pthread.c my_thr_init.c
+endif
+
 EXTRA_DIST =		thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
 			thr_mutex.c thr_rwlock.c mf_soundex.c my_conio.c \
 			my_wincond.c my_winthread.c CMakeLists.txt
-libmysys_a_LIBADD =	@THREAD_LOBJECTS@
-# test_dir_DEPENDENCIES=	$(LIBRARIES)
-# testhash_DEPENDENCIES=	$(LIBRARIES)
-# test_charset_DEPENDENCIES=	$(LIBRARIES)
-# charset2html_DEPENDENCIES=	$(LIBRARIES)
+# test_dir_DEPENDENCIES=	$(LTLIBRARIES)
+# testhash_DEPENDENCIES=	$(LTLIBRARIES)
+# test_charset_DEPENDENCIES=	$(LTLIBRARIES)
+# charset2html_DEPENDENCIES=	$(LTLIBRARIES)
 EXTRA_PROGRAMS =	
 DEFS =			-DDEFAULT_BASEDIR=\"$(prefix)\" \
 			-DDATADIR="\"$(MYSQLDATAdir)\"" \
@@ -74,8 +77,6 @@
 			-DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \
                         @DEFS@
 
-libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@
-
 # I hope this always does the right thing. Otherwise this is only test programs
 FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
 
@@ -84,41 +85,41 @@
 # which automaticly removes the object files you use to compile a final program
 #
 
-test_thr_alarm$(EXEEXT): thr_alarm.c $(LIBRARIES)
+test_thr_alarm$(EXEEXT): thr_alarm.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/thr_alarm.c ./test_thr_alarm.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_thr_alarm.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_thr_alarm.c
 
-test_thr_lock$(EXEEXT): thr_lock.c $(LIBRARIES)
+test_thr_lock$(EXEEXT): thr_lock.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/thr_lock.c test_thr_lock.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_thr_lock.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_thr_lock.c
 
-test_vsnprintf$(EXEEXT): my_vsnprintf.c $(LIBRARIES)
+test_vsnprintf$(EXEEXT): my_vsnprintf.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/my_vsnprintf.c test_vsnprintf.c
 	$(LINK) $(FLAGS) -DMAIN ./test_vsnprintf.c $(LDADD) $(LIBS)
 	$(RM) -f test_vsnprintf.c
 
-test_io_cache$(EXEEXT): mf_iocache.c $(LIBRARIES)
+test_io_cache$(EXEEXT): mf_iocache.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/mf_iocache.c test_io_cache.c
 	$(LINK) $(FLAGS) -DMAIN ./test_io_cache.c $(LDADD) $(LIBS)
 	$(RM) -f test_io_cache.c
 
-test_dir$(EXEEXT): test_dir.c $(LIBRARIES)
+test_dir$(EXEEXT): test_dir.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_dir.c $(LDADD) $(LIBS)
 
-test_charset$(EXEEXT): test_charset.c $(LIBRARIES)
+test_charset$(EXEEXT): test_charset.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS)
 
-testhash$(EXEEXT): testhash.c $(LIBRARIES)
+testhash$(EXEEXT): testhash.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN $(srcdir)/testhash.c $(LDADD) $(LIBS)
 
-test_gethwaddr$(EXEEXT): my_gethwaddr.c $(LIBRARIES)
+test_gethwaddr$(EXEEXT): my_gethwaddr.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/my_gethwaddr.c ./test_gethwaddr.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_gethwaddr.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_gethwaddr.c
 
-test_base64$(EXEEXT): base64.c $(LIBRARIES)
+test_base64$(EXEEXT): base64.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/base64.c ./test_base64.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_base64.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_base64.c
diff -uNr mysql-5.0.76-old/netware/Makefile.am mysql-5.0.76/netware/Makefile.am
--- mysql-5.0.76-old/netware/Makefile.am	2009-01-15 16:48:03.000000000 -0100
+++ mysql-5.0.76/netware/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -16,14 +16,13 @@
 
 if HAVE_NETWARE
 INCLUDES =			-I$(top_builddir)/include -I$(top_srcdir)/include -I..
-LDADD =				@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
-				../dbug/libdbug.a ../strings/libmystrings.a
+LDADD =				@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.la
 bin_PROGRAMS =			mysqld_safe mysql_install_db mysql_test_run libmysql
 mysqld_safe_SOURCES=		mysqld_safe.c my_manage.c
 mysql_install_db_SOURCES=	mysql_install_db.c my_manage.c
 mysql_test_run_SOURCES=		mysql_test_run.c my_manage.c
 libmysql_SOURCES=		libmysqlmain.c
-libmysql_LDADD =		../libmysql/.libs/libmysqlclient.a \
+libmysql_LDADD =		../libmysql/.libs/libmysqlclient.la \
 				@openssl_libs@ @yassl_libs@
 
 netware_build_files =           client/mysql.def client/mysqladmin.def \
diff -uNr mysql-5.0.76-old/pstack/Makefile.am mysql-5.0.76/pstack/Makefile.am
--- mysql-5.0.76-old/pstack/Makefile.am	2009-01-15 16:48:04.000000000 -0100
+++ mysql-5.0.76/pstack/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -27,8 +27,8 @@
 EXTRA_DIST=		$(SRC)
 
 if COMPILE_PSTACK
-pkglib_LIBRARIES =	libpstack.a
-libpstack_a_SOURCES =	bucomm.c filemode.c linuxthreads.c rddbg.c debug.c ieee.c pstack.c stabs.c
+pkglib_LTLIBRARIES =	libpstack.la
+libpstack_la_SOURCES =	bucomm.c filemode.c linuxthreads.c rddbg.c debug.c ieee.c pstack.c stabs.c
 endif
 
 # Don't update the files from bitkeeper
diff -uNr mysql-5.0.76-old/regex/Makefile.am mysql-5.0.76/regex/Makefile.am
--- mysql-5.0.76-old/regex/Makefile.am	2009-01-15 16:48:05.000000000 -0100
+++ mysql-5.0.76/regex/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -16,10 +16,10 @@
 # MA 02111-1307, USA
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include
-noinst_LIBRARIES =	libregex.a
-LDADD=			libregex.a $(top_builddir)/strings/libmystrings.a
+noinst_LTLIBRARIES =	libregex.la
+LDADD=			libregex.la $(top_builddir)/strings/libmystrings.la
 noinst_HEADERS =	cclass.h cname.h regex2.h utils.h engine.c my_regex.h
-libregex_a_SOURCES =	regerror.c regcomp.c regexec.c regfree.c reginit.c
+libregex_la_SOURCES =	regerror.c regcomp.c regexec.c regfree.c reginit.c
 noinst_PROGRAMS =	re
 re_SOURCES =		split.c debug.c main.c
 re_LDFLAGS= @NOINST_LDFLAGS@
diff -uNr mysql-5.0.76-old/sql/Makefile.am mysql-5.0.76/sql/Makefile.am
--- mysql-5.0.76-old/sql/Makefile.am	2009-01-15 16:48:09.000000000 -0100
+++ mysql-5.0.76/sql/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -29,14 +29,13 @@
 EXTRA_PROGRAMS =	gen_lex_hash
 bin_PROGRAMS =		mysql_tzinfo_to_sql
 gen_lex_hash_LDFLAGS =  @NOINST_LDFLAGS@
-LDADD =			$(top_builddir)/myisam/libmyisam.a \
-			$(top_builddir)/myisammrg/libmyisammrg.a \
-			$(top_builddir)/heap/libheap.a \
-			$(top_builddir)/vio/libvio.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/regex/libregex.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@ @NDB_SCI_LIBS@
+LDADD =			$(top_builddir)/myisam/libmyisam.la \
+			$(top_builddir)/myisammrg/libmyisammrg.la \
+			$(top_builddir)/heap/libheap.la \
+			$(top_builddir)/vio/libvio.la \
+			$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/regex/libregex.la \
+			@ZLIB_LIBS@ @NDB_SCI_LIBS@
 
 mysqld_LDADD =		@MYSQLD_EXTRA_LDFLAGS@ \
 			@bdb_libs@ @innodb_libs@ @pstack_libs@ \
@@ -52,8 +51,7 @@
 			procedure.h sql_class.h sql_lex.h sql_list.h \
 			sql_manager.h sql_map.h sql_string.h unireg.h \
 			sql_error.h field.h handler.h mysqld_suffix.h \
-			ha_myisammrg.h\
-			ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \
+			ha_heap.h ha_berkeley.h ha_innodb.h \
 			ha_ndbcluster.h ha_ndbcluster_cond.h \
 			opt_range.h protocol.h \
 			sql_select.h structs.h table.h sql_udf.h hash_filo.h\
@@ -87,7 +85,7 @@
 			unireg.cc des_key_file.cc \
 			discover.cc time.cc opt_range.cc opt_sum.cc \
 		   	records.cc filesort.cc handler.cc \
-		        ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
+		        ha_heap.cc \
 	                ha_berkeley.cc ha_innodb.cc \
 			ha_ndbcluster.cc ha_ndbcluster_cond.cc \
 			sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
diff -uNr mysql-5.0.76-old/sql/set_var.h mysql-5.0.76/sql/set_var.h
--- mysql-5.0.76-old/sql/set_var.h	2009-01-15 16:48:16.000000000 -0100
+++ mysql-5.0.76/sql/set_var.h	2009-03-15 14:39:34.000000000 -0100
@@ -43,16 +49,16 @@
   struct my_option *option_limits;	/* Updated by by set_var_init() */
   uint name_length;			/* Updated by by set_var_init() */
   const char *name;
-  
+
   sys_after_update_func after_update;
   bool no_support_one_shot;
   /*
-    true if the value is in character_set_filesystem, 
+    true if the value is in character_set_filesystem,
     false otherwise.
-    Note that we can't use a pointer to the charset as the system var is 
+    Note that we can't use a pointer to the charset as the system var is
     instantiated in global scope and the charset pointers are initialized
     later.
-  */  
+  */
   bool is_os_charset;
   sys_var(const char *name_arg, sys_after_update_func func= NULL)
     :name(name_arg), after_update(func)
@@ -261,8 +267,8 @@
 public:
   sys_var_const_os_str(const char *name_arg, const char *value_arg)
     :sys_var_const_str(name_arg, value_arg)
-  { 
-    is_os_charset= TRUE; 
+  {
+    is_os_charset= TRUE;
   }
 };
 
@@ -302,14 +308,14 @@
   sys_var_const_os_str_ptr(const char *name_arg, char **value_arg)
     :sys_var_const_str_ptr(name_arg, value_arg)
   {
-    is_os_charset= TRUE; 
+    is_os_charset= TRUE;
   }
 };
 
 
 class sys_var_enum :public sys_var
 {
-  uint	*value; 
+  uint	*value;
   TYPELIB *enum_names;
 public:
   sys_var_enum(const char *name_arg, uint *value_arg,
@@ -515,7 +521,7 @@
 public:
   ulonglong bit_flag;
   bool reverse;
-  sys_var_thd_bit(const char *name_arg, 
+  sys_var_thd_bit(const char *name_arg,
                   sys_check_func c_func, sys_update_func u_func,
                   ulonglong bit, bool reverse_arg=0)
     :sys_var_thd(name_arg), check_func(c_func), update_func(u_func),
@@ -674,7 +680,7 @@
 {
 public:
   sys_var_character_set_results(const char *name_arg) :
-    sys_var_character_set(name_arg) 
+    sys_var_character_set(name_arg)
     { nullable= 1; }
   void set_default(THD *thd, enum_var_type type);
   CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
@@ -807,7 +813,7 @@
   sys_var_readonly(const char *name_arg, enum_var_type type,
 		   SHOW_TYPE show_type_arg,
 		   sys_value_ptr_func value_ptr_func_arg)
-    :sys_var(name_arg), var_type(type), 
+    :sys_var(name_arg), var_type(type),
        show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg)
   {}
   bool update(THD *thd, set_var *var) { return 1; }
@@ -840,7 +846,7 @@
 {
 public:
   sys_var_thd_time_zone(const char *name_arg):
-    sys_var_thd(name_arg) 
+    sys_var_thd(name_arg)
   {
     no_support_one_shot= 0;
   }
@@ -889,7 +895,7 @@
 {
 public:
   sys_var_thd_lc_time_names(const char *name_arg):
-    sys_var_thd(name_arg) 
+    sys_var_thd(name_arg)
   {
 #if MYSQL_VERSION_ID < 50000
     no_support_one_shot= 0;
@@ -954,7 +960,7 @@
     if (value_arg && value_arg->type() == Item::FIELD_ITEM)
     {
       Item_field *item= (Item_field*) value_arg;
-      if (!(value=new Item_string(item->field_name, 
+      if (!(value=new Item_string(item->field_name,
                   (uint) strlen(item->field_name),
 				  item->collation.collation)))
 	value=value_arg;			/* Give error message later */
diff -uNr mysql-5.0.76-old/strings/Makefile.am mysql-5.0.76/strings/Makefile.am
--- mysql-5.0.76-old/strings/Makefile.am	2009-01-15 16:48:34.000000000 -0100
+++ mysql-5.0.76/strings/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -16,7 +16,7 @@
 # This file is public domain and comes with NO WARRANTY of any kind
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include
-pkglib_LIBRARIES =	libmystrings.a
+noinst_LTLIBRARIES =	libmystrings.la
 
 # Exact one of ASSEMBLER_X
 if ASSEMBLER_x86
@@ -37,7 +37,7 @@
 endif
 endif
 
-libmystrings_a_SOURCES = $(ASRCS) $(CSRCS)
+libmystrings_la_SOURCES = $(ASRCS) $(CSRCS)
 noinst_PROGRAMS = conf_to_src
 # Default charset definitions
 EXTRA_DIST =		ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-win1250ch.c \
@@ -54,25 +54,25 @@
 			strnmov-sparc.s strstr-sparc.s strxmov-sparc.s \
 			t_ctype.h CMakeLists.txt
 
-libmystrings_a_LIBADD=
-conf_to_src_SOURCES = conf_to_src.c xml.c ctype.c bcmp.c
-conf_to_src_LDADD=
+libmystrings_la_LIBADD=
+conf_to_src_SOURCES = conf_to_src.c
+conf_to_src_LDADD = libmystrings.la
 #force static linking of conf_to_src - essential when linking against
 #custom installation of libc
-conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
+#conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
 
 # This is because the dependency tracking misses @FOO@ vars in sources.
 #strtoull.o:		@CHARSET_OBJS@
 
 
-FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
+FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 
-str_test: str_test.c $(pkglib_LIBRARIES)
-	$(LINK) $(FLAGS) -DMAIN $(INCLUDES) $(srcdir)/str_test.c $(LDADD) $(pkglib_LIBRARIES)
+str_test: str_test.c $(pkglib_LTLIBRARIES)
+	$(LINK) $(FLAGS) -DMAIN $(INCLUDES) $(srcdir)/str_test.c $(LDADD) $(pkglib_LTLIBRARIES)
 
-test_decimal$(EXEEXT): decimal.c $(pkglib_LIBRARIES)
+test_decimal$(EXEEXT): decimal.c $(pkglib_LTLIBRARIES)
 	$(CP) $(srcdir)/decimal.c ./test_decimal.c
-	$(LINK) $(FLAGS) -DMAIN  ./test_decimal.c $(LDADD) $(pkglib_LIBRARIES)
+	$(LINK) $(FLAGS) -DMAIN  ./test_decimal.c $(LDADD) $(pkglib_LTLIBRARIES)
 	$(RM) -f ./test_decimal.c
 
 # Don't update the files from bitkeeper
diff -uNr mysql-5.0.76-old/tests/Makefile.am mysql-5.0.76/tests/Makefile.am
--- mysql-5.0.76-old/tests/Makefile.am	2009-01-15 16:48:39.000000000 -0100
+++ mysql-5.0.76/tests/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -42,11 +42,11 @@
 
 insert_test_SOURCES=       insert_test.c
 select_test_SOURCES=       select_test.c
-insert_test_DEPENDENCIES=	$(LIBRARIES) $(pkglib_LTLIBRARIES)
-select_test_DEPENDENCIES=	$(LIBRARIES) $(pkglib_LTLIBRARIES)
+insert_test_DEPENDENCIES=	$(LTLIBRARIES) $(pkglib_LTLIBRARIES)
+select_test_DEPENDENCIES=	$(LTLIBRARIES) $(pkglib_LTLIBRARIES)
 
 bug25714_SOURCES=          bug25714.c
-bug25714_DEPENDENCIES=     $(LIBRARIES) $(pkglib_LTLIBRARIES)
+bug25714_DEPENDENCIES=     $(LTLIBRARIES) $(pkglib_LTLIBRARIES)
 
 # Fix for mit-threads
 DEFS =			-DUNDEF_THREADS_HACK
diff -uNr mysql-5.0.76-old/tools/Makefile.am mysql-5.0.76/tools/Makefile.am
--- mysql-5.0.76-old/tools/Makefile.am	2009-01-15 16:48:40.000000000 -0100
+++ mysql-5.0.76/tools/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -23,7 +23,7 @@
 
 bin_PROGRAMS=		mysqltestmanager
 mysqltestmanager_SOURCES=	mysqlmanager.c
-mysqltestmanager_DEPENDENCIES=	$(LIBRARIES) $(pkglib_LTLIBRARIES)
+mysqltestmanager_DEPENDENCIES=	$(LTLIBRARIES) $(pkglib_LTLIBRARIES)
 DEF=			-DUNDEF_THREADS_HACK
 
 # Don't update the files from bitkeeper
diff -uNr mysql-5.0.76-old/vio/Makefile.am mysql-5.0.76/vio/Makefile.am
--- mysql-5.0.76-old/vio/Makefile.am	2009-01-15 16:48:40.000000000 -0100
+++ mysql-5.0.76/vio/Makefile.am	2009-03-15 14:39:34.000000000 -0100
@@ -16,11 +16,11 @@
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include \
 			$(openssl_includes)
 LDADD =			@CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) $(yassl_libs)
-pkglib_LIBRARIES =	libvio.a
+pkglib_LTLIBRARIES =	libvio.la
 
 noinst_HEADERS =	vio_priv.h
 
-libvio_a_SOURCES =	vio.c viosocket.c viossl.c viosslfactories.c
+libvio_la_SOURCES =	vio.c viosocket.c viossl.c viosslfactories.c
 
 EXTRA_DIST=	CMakeLists.txt